/ Published in: C++
URL: http://www.coopknow.com/papers.asp?paper=5
A Windows 32-bit DLL does not require any special functions. If you want to initialize your DLL when it is loaded, you can have a function called DllMain and do your initialization, but it is not required. Windows calls the DllMain function of a DLL in four instances:
* When a process attaches the DLL
* When a thread attaches the DLL
* When a process detaches the DLL
* When a thrad detaches the DLL
Expand |
Embed | Plain Text
BOOL WINAPI DllMain(HINSTANCE hInstance,DWORD fwdReason, LPVOID lpvReserved) { switch(fwdReason) { case DLL_PROCESS_ATTACH: break; case DLL_THREAD_ATTACH: break; case DLL_PROCESS_DETACH: break; case DLL_THREAD_DETACH: break; } return(TRUE); // The initialization was successful, a FALSE will abort // the DLL attach }
You need to login to post a comment.
