Customizing DLL unloading

To unload a SOM class, the SOMClassMgrObject calls the function pointed to by the global variable SOMDeleteModule. The SOMDeleteModule function has the following signature:

long (*SOMDeleteModule) (in somToken modHandle);

This function is responsible for unloading the DLL designated by the modHandle parameter and returning either zero (for success) or a nonzero system-specific error code. The parameter modHandle contains the value returned by the DLL loading routine (described above) when the DLL was loaded.

An application program can replace the default DLL-unloading routine by assigning the entry point address of the new DLL-unloading function (such as, MyDeleteModule) to the global variable SOMDeleteModule, as follows:

#include <som.h>
/* Define a replacement routine: */
long myDeleteModule (somToken modHandle)
{
     (Customized code goes here)
}
...
SOMDeleteModule = MyDeleteModule;


[Back: Customizing DLL loading]
[Next: Customizing Character Output]