mfc共享dll,應用程式A加載了dll,顯示了視窗,一切正常,當應用程式B加載dll時,卻加載了已被A初始化過的dll,導致B不確定性崩潰,怎么樣才能使B加載未被初始化的dll。
謝謝。
uj5u.com熱心網友回復:
The following example demonstrates how to structure the DLL entry-point function.BOOL WINAPI DllMain(
HINSTANCE hinstDLL, // handle to DLL module
DWORD fdwReason, // reason for calling function
LPVOID lpReserved ) // reserved
{
// Perform actions based on the reason for calling.
switch( fdwReason )
{
case DLL_PROCESS_ATTACH:
// Initialize once for each new process.
// Return FALSE to fail DLL load.
break;
case DLL_THREAD_ATTACH:
// Do thread-specific initialization.
break;
case DLL_THREAD_DETACH:
// Do thread-specific cleanup.
break;
case DLL_PROCESS_DETACH:
// Perform any necessary cleanup.
break;
}
return TRUE; // Successful DLL_PROCESS_ATTACH.
}
?
uj5u.com熱心網友回復:
MSDN98_1.ISO http://pan.baidu.com/s/1dDF41ix, MSDN98_2.ISO http://pan.baidu.com/s/1bnGo0Vl
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/252760.html
標籤:C++ 語言
上一篇:【C語言】實作楊輝三角
