|
||
Using a Win32 DLL |
||||||||||||||||||||||
If you choose to use a Win32 DLL, then you will need to provide a DllMain function.
|
||||||||||||||||||||||
The DllMain function is a requirement for Win32 DLLs. The DllMain function is called just after your DLL is loaded, and again just prior to its removal. DllMain is also called when the SilverScreen process creates or destroys a thread. DllMain is used to initialize the DLL; in particular, the C run-time library and some static C++ objects are initialized then, also, an important piece of data -- the instance (or module) handle for the DLL -- is passed to DllMain when the DLL is being loaded. The instance handle is necessary for loading other resources from the DLL module.
Note that under some uses of the MFC for DLLs, the DllMain function is hidden inside the MFC mechanisms.
|
||||||||||||||||||||||
The prototype for DllMain should match the following:
The parameters have the following meanings:
|
||||||||||||||||||||||