Note!
If this DLL is dynamically linked against the MFC DLLs, any functions exported from this DLL which call into MFC must have the AFX_MANAGE_STATE macro added at the very beginning of the function.
For example:
extern "C" BOOL PASCAL EXPORT ExportedFunction()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
normal function body here
}
It is very important that this macro appear in each function, prior to any calls into MFC. This means that it must appear as the first statement within the function, even before any object variable declarations as their constructors may generate calls into the MFC DLL.
Please see MFC Technical Notes 33 and 58 for additional details.
機器翻譯很啥B,看不太懂,所以想問問大家怎么理解。
If this DLL is dynamically linked against the MFC DLLs,
百度說:如果此DLL與MFC DLL動態鏈接,
GG說:如果此DLL是與MFC DLL動態鏈接的,
它本身是個DLL了,怎么又與MFC DLL們搞什么動態鏈接呢?看不明白
uj5u.com熱心網友回復:
我的翻譯:If this DLL is dynamically linked against the MFC DLLs, any functions exported from this DLL which call into MFC must have the AFX_MANAGE_STATE macro added at the very beginning of the function.
如果此DLL是與MFC DLL們動態鏈接(真看不懂邏輯),則在MFC程式里呼叫此DLL匯出的任何函式時,必須在函式開頭添加 AFX_MANAGE_STATE宏。
uj5u.com熱心網友回復:
自身是個DLL,也可以呼叫其他DLL的功能,這句話是說:如果你這個DLL設定了“在共享DLL中使用MFC”,那么你的匯出函式就需要加這個。
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/257918.html
標籤:進程/線程/DLL
