The DLLMAIN.C file (located in the \TOOLKIT\SAMPLES\OPEN32\DLLENTRY subdirectory) contains the DLL initialization/termination function, which is called when a process gains or loses access to the DLL. The .DEF file used to build the DLL needs to specify INITINSTANCE and TERMINSTANCE; otherwise, this function will be called only for the first process to gain access and the last process to free up the DLL.

This implementation is for IBM VisualAge C++ and assumes that the C Runtime library is being statically linked to the DLL and that the library uses C++ classes.


[Back] [Next]