BOOL __stdcall DllMain(HINSTANCE hModule, DWORD dwReason, LPVOID lpReserved)
{
switch (dwReason)
{
case DLL_PROCESS_ATTACH:
// 禁用指定的DLL的DLL_THREAD_ATTACH和DLL_THREAD_DETACH通知
DisableThreadLibraryCalls(hModule);
CreateThread(0, 0, (LPTHREAD_START_ROUTINE)Code, 0, 0, 0);
//或者直接return true
break;
case DLL_PROCESS_DETACH: break;
}
return TRUE;
}
解决C++DLL死锁
最新推荐文章于 2024-07-08 21:29:23 发布