
                                  README.TXT

                    Documentation for DEFMGR32.EXE Utility

              Copyright (c) 1995 by Periphere (Luc Vancraen (CIS:100117,265))
              
Version 1.0:

  Version 1.0 incorporates the following features:

* Dllxport now handles either *.map files (generated when developing 16-bit DLL's)
 		       or     a dump file created with dumpbin.exe out of a project
				*.obj files (eg. DUMPBIN /SYMBOLS *.obj >myProj.dmp)
 
* Automatic detection of previous exported functions that have been removed
  after a new complation stage
  
* Complete support for DLL's Written in C++ (all access-sorts are shown)   

* Persist DEF file headers along with the ordinals. The maximum ordinal number
  id saved so any new function gets a new higher ordinal. (automatic increment)
  
  example.def:
***********************************************************************************
<<Begin File>>
  
; File generated by Module Definition Manager : Do not change !

; --------------------- Header Section Begin ---------------------
; NextOrdinalValue = 572
; Platform = Windows-16
; ---------------------- Header Section End ----------------------

; ------------------- Protected Section Begin --------------------
LIBRARY   COMMON
EXETYPE   WINDOWS
CODE      PRELOAD MOVEABLE DISCARDABLE
DATA      PRELOAD MOVEABLE SINGLE
HEAPSIZE  1024
EXPORTS

          WEP @1 RESIDENTNAME PRIVATE;REQUIRED WEP ENTRY POINT (USES LIB WEP)
; -------------------- Protected Section End ---------------------


; --------------------- Export Sextion Begin ---------------------
EXPORTS

; Symbol name = public: virtual struct CRuntimeClass* CWatchBuffer::GetRuntimeClass(void)const
    ?GetRuntimeClass@CWatchBuffer@@VFCPEUCRuntimeClass@@XZ @570 NONAME

; Symbol name = public: static struct CRuntimeClass CWatchBuffer::classCWatchBuffer
    ?classCWatchBuffer@CWatchBuffer@@2UCRuntimeClass@@E @569 NONAME

; Symbol name = public: CDirList::CDirList(void)
    ??0CDirList@@REC@XZ @241 NONAME

; Symbol name = public: void CDirList::ClearList(void)
    ?ClearList@CDirList@@RECXXZ @248 NONAME

; Symbol name = public: class CDirSpec const* CDirList::GetAt(int)const
    ?GetAt@CDirList@@RFCPFVCDirSpec@@H@Z @243 NONAME

( ... More functions )

; Symbol name = public: class CDescription& CDescription::operator=(class CDescription const&)
    ??4CDescription@@RECAEV0@AFV0@@Z @228 NONAME

; Symbol name = public: virtual CDescription::~CDescription(void)
    ??1CDescription@@VEC@XZ @232 NONAME

; --------------------- Export Section End -----------------------
  
  <<End Of File>>
**********************************************************************************
  
  Every exported function exists of :
	1. A remark sating the access method and the C++ function name.
 	2. The mangled name followed by the ordinal   
  
* Faster parsing algorithms should make defmgr32 less burdensome. 
  
* No limit on the number of exports.  Defmgr32 will parse and stream exports
  until memory is exhausted (which is a very long time in Windows NT).
  
Purpose:

  DEFMGR32 eliminates the need to manually maintain .DEF files for Visual C++ DLL's by      creating the .DEF file from the .OBJ's used to create it or from the generated map file.

Method:

************************** 16 bit ************************************************

First you must compile and link your DLL with the Microsoft Compiler (Visual C++, Version 1.5X). Let the compiler build a complete MAP-File.

Start the DefMgr32 Application and open the Map-File with the open button on the first page. DefMgr32 imports then all classes.

Now you can devide your work(exporting all necassary functions) into smaller pieces
by eg. specifying with which class you want to work first. Maybe specifying further
access method you want to work with first (public, protected, ...) Most of the time
you want to export only the public functions of a class.

After choosing one or more functions (the list is multiselectable), you can click on the export button on the first page to really export those selected functions.  Defmgr32 assigns
the ordinals automatically in an increasing order.

Repeat this steps until you have exported all desired methodes from all desired classes.

You can remove every definitions for any classes you made by selecting the right function on the export page(second page) and by clicking on the remove button.
Now those selected entries will be removed and their ordinals numbers will not be reused
to avoid conflicts. When adding them again, they will be assigned new values.

After you have defined all exports you must save all definitions into a definitions file by clicking on the save or save as buttons on the export page.

To get a working import library you must execute the microsoft tool implib with the new DEF-File.

If you make changes to your DLL you can import the old definitions with the open button on the export page. When you as second step also read the map file of your changed DLL,
DefMgr32 will detect any inconsistensies between the new map and the old def-file.

************************** 32 bit ************************************************
First you must compile and link your DLL with the Microsoft Compiler (Visual C++, Version 2.X and later). Go to the directory where all the obj files of your project are gathered.
Run the Microsoft DUMPBIN tool as follows:
	DUMPBIN /SYMBOLS *.obj >myproj.dmp

This means extract all symbolic information (used by the Defmgr32 to find all functions)
from the object files (*.obj) in this directory and save the output in a file called
"myproj.dmp" The extension 'dmp' is purely our convention.  The Defmgr32 knows it as a
dump file from 32 object files.

Start the DefMgr32 Application and open the dmp-File with the open button on the first page. DefMgr32 imports then all classes.

The rest of the method-description is the same as in 16-bit. Only afterwards running implib
is not required in 32-bit.

  Compiler switches: the /Gy compiler flag is incompatible with this program.
The /O1 optimization flag implies /Gy, if small-code optimization is required,
you may have to resort to compiling without that flag, saving the .DEF file
and recompiling with it. The /NOPACKF option prevents the removal of
unreferenced packaged functions, which may be created with the /Gy compiler
option and are always created by C++ member functions. The default action of
the linker is to remove unreferenced packaged functions. See "Enable Function
Level Linking" in Chapter 1 of the Command-Line Utilities User's Guide for a
description of packaged functions.  Note  If you are linking a dynamic-link
library for Windows or a Visual Basic custom control which was compiled with
the /O1 optimizing option, select this option to prevent removal of exported
functions. The /O1 option implies the /Gy option.

  There is a bug in IMPLIB 1.50 which causes it to fail on an
exported name greater than 127 characters in length.  While neither the
programmer nor this program has any control of the length of a mangled name,
it is a problem that could come up.  Microsoft has instructed us to use
shorter symbol names to avoid this problem.  Thanks MS! See Q117797.

DefMgr32 Command Line:

DefMgr32 [[options]] [objectfile]

Options:

 [defFile]
  a existing def file. Must have extension 'def'

 [Choicefile]
  a existing file. Must be either a map file or a dump from a number of obj files


Version History

1.00 - initial revision

DISCLAIMER - AGREEMENT

Users of DEFMGR32 must accept this disclaimer of warranty:
"DEFMGR32" is supplied as is.  The author disclaims all warranties, expressed
or implied, including, without limitation, the warranties of merchantability
and of fitness for any purpose.  The author assumes no liability for damages,
direct or conse- quential, which may result from the use of DEFMGR32 ."

DEFMGR32  is a "shareware program" and is provided at no charge to the user for
evaluation.  Feel free to share it with your friends, but please do not give
it away altered or as part of another system.  The essence of "user-supported"
software is to provide personal computer users with quality software without
high prices, and yet to provide incentive for programmers to continue to
develop new products.  If you find this program useful and find that you are
using DEFMGR32 and continue to use DEFMGR32 after a reasonable trial period,
you must make a registration payment of $29 to Periphere(the people behind the
scenes).  The $29 registration fee will license one copy for use on any one computer
at any one time.  You must treat this software just like a book.  An example is that
this software may be used by any number of people and may be freely moved from one
computer location to another, so long as there is no possibility of it being used
at one location while it's being used at another.
Just as a book cannot be read by two different persons at the same time.

Commercial users of DEFMGR32 must register and pay for their copies of
DEFMGR32 within 30 days of first use or their license is withdrawn.
Site-License arrangements may be made by contacting Periphere.


For an additional $50, source code to the utility is available (without
support, in MFC 3.0).


!!! ONLINE REGISTRATION !!!
You can register online at CompuServe and the commercial version will be emailed
to the registration account as soon as possible.  The process is simple,
just !GO SWREG and follow the directions using the following registration 
numbers:

DEFMGR32 registration #7989 (v1.0 without source)

