i want to do some initializing when a dll is loaded.... this is my dll of course, and what i want to do is actually initialize winsock...
ok...
this is my code for DllMain:
where exactly should i put it? (keep in mind i also want to denitialize and cleanup winsock when the dll is unloaded...)Code:BOOL APIENTRY DllMain (HINSTANCE hInst /* Library instance handle. */ , DWORD reason /* Reason this function is being called. */ , LPVOID reserved /* Not used. */ ) { switch (reason) { case DLL_PROCESS_ATTACH: break; case DLL_PROCESS_DETACH: break; case DLL_THREAD_ATTACH: break; case DLL_THREAD_DETACH: break; } /* Returns TRUE on success, FALSE on failure */ return TRUE; }
thanks in advance!
seec77