错误 1 fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>
d:/program/visual studio 2008/vc/atlmfc/include/afxv_w32.h 16 OpenAdo
MFC连接数据库出现这个原因是因为导入了:
#import "C:/program files/common files/system/ado/msado15.dll" no_namespace rename("EOF", "adoEOF")
导入是没错,不过导入的位置错了。
stdafx.h----这个文件里面的内容:
#include <afxwin.h> // MFC 核心组件和标准组件
#include <afxext.h> // MFC 扩展
#include <afxdisp.h> // MFC 自动化类
#ifndef _AFX_NO_OLE_SUPPORT
#include <afxdtctl.h> // MFC 对 Internet Explorer 4 公共控件的支持
#endif
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h>
如果把
#import "C:/program files/common files/system/ado/msado15.dll" no_namespace rename("EOF", "adoEOF")
放在前面的话,会出现前面提的错误
放在后面就不会,如果还不行,就放在最后面。
这是解决这个问题办法之一。不知还有其他的不?
不知道导入msado15.dll里面是否有#include <windows.h>这个代码。
希望大家来研究一下