LoadLibrary VB&C 不同
DLLMain函数如下:BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{ switch(ul_reason_for_call)
{
case DLL_PROCESS_ATTACH://DLL被加载
MessageBox(0,"DLL正被加载 !","DllMessage",0);
break;
case DLL_PROCESS_DETACH:
MessageBox(0,"进程将要退出!","DllMessage",0);
break;
default:
break;
}
return TRUE;
}
为什么使用VB调用时DLL会出现"DLL正被加载"提示框,而用C怎么不提示呢?
//c代码
LoadLibrary("MonitorDll.dll");//LoadLibraryA,LoadLibraryW我都试过 返回值是正确的
'vb代码
LoadLibrary("MonitorDll.dll")
为什么使用VB调用时DLL会出现"DLL正被加载"提示框,而用C怎么不提示呢?