我新建了一个MFC基于对话框的应用程序,,编译无错,可当我在StdAfx.h中 加入
#import "c:\program files\common files\system\ado\msado15.dll" \
    no_namespace \
    rename ("EOF", "adoEOF")
编译就会提示#error :  WINDOWS.H already included.  MFC apps must not #includ,这是怎么回事啊??书上都是那样讲的,,可以我的为什么会出错??请各位帮忙解答以下,感激不尽!!

解决方案 »

  1.   


    #import"c:\Program Files\Common Files\System\ado\msado15.dll"\
    no_namespace rename("EOF","adoEOF")\
    rename("BOF","adoBOF")
    的位置没放好,应放在以下的后面。// stdafx.h : 标准系统包含文件的包含文件,
    // 或是经常使用但不常更改的
    // 特定于项目的包含文件#pragma once
    #ifndef _SECURE_ATL
    #define _SECURE_ATL 1
    #endif#ifndef VC_EXTRALEAN
    #define VC_EXTRALEAN            // 从 Windows 头中排除极少使用的资料
    #endif#include "targetver.h"#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS      // 某些 CString 构造函数将是显式的// 关闭 MFC 对某些常见但经常可放心忽略的警告消息的隐藏
    #define _AFX_ALL_WARNINGS#import"c:\Program Files\Common Files\System\ado\msado15.dll"\ //ERROR
    no_namespace rename("EOF","adoEOF")\
    rename("BOF","adoBOF")
    #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>                     // MFC 对 Windows 公共控件的支持
    #endif // _AFX_NO_AFXCMN_SUPPORT#ifdef _UNICODE
    #if defined _M_IX86
    #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
    #elif defined _M_IA64
    #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'\"")
    #elif defined _M_X64
    #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
    #else
    #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
    #endif
    #endif
    #import"c:\Program Files\Common Files\System\ado\msado15.dll"\ //NO ERROR
    no_namespace rename("EOF","adoEOF")\
    rename("BOF","adoBOF")
    #include <windows.h>