发布网友 发布时间:2022-04-23 18:50
共1个回答
热心网友 时间:2023-08-25 07:52
在DllMain中加入代码
Case DLL_PROCESS_ATTACH;
//运行代码
break;
我建立的DLL名称为GameDLl
在GameDll.cpp中加入这段代码
BOOL APIENTRY DllMain( HANDLE hMole, DWORD ul_reason_for_call, LPVOID lpReserved )
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
//通常代码都加在这里
Game_Run();
break;
case DLL_THREAD_ATTACH:
break;
case DLL_THREAD_DETACH:
break;
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}