I have converted a mixed mode MFC application from VS2005 to VS2008. It is compiling OK but when starting the application I get an assert in afxwin1.inl because afxCurrentResourceHandle = NULL.
This is before MyCWinApp::InitInstance is called. The call stack is
mfc90d.dll->AfxWinInit (with HINSTANCE = NULL)
myapp.exe!InternalDllMain
myapp.exe!PostDllMain
myapp.exe!dynamic intilizer for postDllMain::A0x61ae6c8e
The same project in VS2005 starts up fine and I notice that instead of PostDllMain beeing called WinMainCRTStarup is being called and it gets a defined instance handle:
mfc80d.dll!AfxWinInit (with HINSTANCE = 0x0040000)
mfc80d.dll!AfxWinMain
myApp.exe!WinMain
myApp.exe!__tmainCRTStartup
myapp.exe!WinMainCRTStartup
The app is compiled with /clr and links to both managed, unmanaged and mixed libs and dlls.
Can anyone shed some light on this issue? Are there any known differences in this area between VS2005 and VS2008?
Thanks!