If you are creating a dynamic link library, you can make a DllMain entry point :
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
if (fdwReason == DLL_PROCESS_ATTACH)
{
return TRUE;
}
else if (fdwReason == DLL_PROCESS_DETACH)
{
}
return TRUE;
}
source
share