// stdafx.h : include file for standard system include files,
//  or project specific include files that are used frequently, but
//      are changed infrequently
//#if !defined(AFX_STDAFX_H__69D053A8_3AB8_448F_AE91_CB2E67748EA8__INCLUDED_)
#define AFX_STDAFX_H__69D053A8_3AB8_448F_AE91_CB2E67748EA8__INCLUDED_#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000//#include "Global.h"//为什么放在这边编译就出错?#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers#include <afxwin.h>         // MFC core and standard components
#include <afxext.h>         // MFC extensions
#include <afxdisp.h>        // MFC Automation classes
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT#include "Global.h"//放在这边就没问题//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.#endif // !defined(AFX_STDAFX_H__69D053A8_3AB8_448F_AE91_CB2E67748EA8__INCLUDED_)请问这是怎么回事,该如何理解里面的头文件标示符?谢谢!

解决方案 »

  1.   

    Global.h你里边可能有MFC的定义吧,你在上面位置#include "Global.h"时,还没有包含到MFC的相关头文件,根据先定义后使用的原则,你在上面包含global.h,里边有关MFC的定义就是无效的,所以编译器会报错
      

  2.   

    因为Global.h里需要上面的头文件
      

  3.   

    显然 Global.h 里用了 windows 或 MFC 的内容而没有包含相关的头文件所以 Global.h 摆在前面,必然破坏了向前声明的规定。
      

  4.   

    安全期间,在StdAfx.h中添加包含文件的时候,最好还是放在系统添加的包含文件之后