http://msdn.microsoft.com/en-us/library/hw85e4bb(v=VS.90).aspx
http://www.codeguru.com/cpp/cpp/cpp_mfc/tutorials/article.php/c4017
MFC Extension DLL -> doesn't have _USRDLL, have DllMain generated, do not have CWinApp instance instantiated
MFC Regular DLL -> have _USRDLL, doesn't have DllMain generated, have CWinApp instantiated
When exporting a function with extern "C"inside an MFC Regular DLL dynamically linked to MFC, we need to put AFX_MANAGE_STATE macro as follows
When exporting a function with extern "C"inside an MFC Regular DLL dynamically linked to MFC, we need to put AFX_MANAGE_STATE macro as follows
extern "C" __declspec(dllexport) int AddFive(int x) { AFX_MANAGE_STATE(AfxGetStaticModuleState( )); return x + 5; }
Build settings (preprocessor defines) for different types of MFC DLL
http://msdn.microsoft.com/en-us/library/aa235516(VS.60).aspx
http://binglongx.spaces.live.com/blog/cns!142CBF6D49079DE8!276.entry
http://msdn.microsoft.com/en-us/library/aa235516(VS.60).aspx
http://binglongx.spaces.live.com/blog/cns!142CBF6D49079DE8!276.entry
How to provide DllMain for MFC Regular DLL
VS2008 DLL Guide
Special care need to be taken when using Regular DLL to access external resources. See the below article:
No comments:
Post a Comment