急!!!ATL中添加mfc 的问题!!!
我在ATL中用到MFC的东西。所以在stdafx.h 中添加MFC的头文件
///////////////////////////////////////////
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit
#ifndef VC_EXTRALEAN
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#endif
//
#include <afx.h>
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#ifndef _AFX_NO_OLE_SUPPORT
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
#endif
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
///////////////////////////////////////////////
结果报错:fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>
在网上查到,如果将#include <atlbase.h>放到afx头文件的后面可以避免这个问题。但是,如果我将atlbase.h放到上面代码的后面。就会出现更多错误:
error C2146: syntax error : missing ';' before identifier 'TheBaseClass'
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
error C2065: 'TheBaseClass' : undeclared identifier
...... ...... ......
还望各位帮帮忙。多谢了!!!!