Free Source Code and Program Tips
CComModule in porting ATL DLL project to VC8
When migrating an ATL project from vc6 to vc8, you will get a problem about CComModule.
Problem:
In vc6, there is such a declaration in stdafx.h as:
and in the main module:
But when you complie it in vc8, the following errors apears:
c:\temp\myatl\stdafx.h(24) : error C2146: syntax error : missing ‘;’ before identifier ‘_Module’
c:\temp\myatl\stdafx.h(24) : error C4430: missing type specifier – int assumed. Note: C++ does not support default-int
c:\temp\myatl\stdafx.h(24) : error C4430: missing type specifier – int assumed. Note: C++ does not support default-int
Solution:
In ATL 7.0, which is the ATL version that is included in Visual C++ .NET and in Visual C++ 2005, the CAtlBaseModule class has replaced the obsolete CComModule class.
Microsoft has given the solution in KB309705 – “_AtlBaseModule.m_hInst replaces _Module.m_hInst in ATL 7.0″
| Print article | This entry was posted by support on June 22, 2007 at 9:33 am, and is filed under Win32/MFC. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |