大家看下一下代码,其中#include <mmsystem.h>这个头文件是我自己加的,其他的都是对话框工程自动生成的,这个#include <mmsystem.h>只能放在#ifndef _AFX_NO_AFXCMN_SUPPORT这句话的顶头位置,放弃他位置均报错。看不出二者有什么关联啊,希望有高手能出来解释下原因。谢谢
#if !defined(AFX_STDAFX_H__D97D07B0_CE65_4B8A_8ADD_FB04B9437C17__INCLUDED_)
#define AFX_STDAFX_H__D97D07B0_CE65_4B8A_8ADD_FB04B9437C17__INCLUDED_#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000#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
#include <mmsystem.h>
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.#endif // !defined(AFX_STDAFX_H__D97D07B0_CE65_4B8A_8ADD_FB04B9437C17__INCLUDED_)
#if !defined(AFX_STDAFX_H__D97D07B0_CE65_4B8A_8ADD_FB04B9437C17__INCLUDED_)
#define AFX_STDAFX_H__D97D07B0_CE65_4B8A_8ADD_FB04B9437C17__INCLUDED_#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000#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
#include <mmsystem.h>
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.#endif // !defined(AFX_STDAFX_H__D97D07B0_CE65_4B8A_8ADD_FB04B9437C17__INCLUDED_)
解决方案 »
- 很中规中矩的开打ADO数据库然后关闭,怎么内存一直增长呢
- 关于 CAsyncSocket Send 的一个小问题!!!!!!!! 马上给分
- 着急问题,在线等 100分 送!!!
- 问个简单的:如何取得一个flash的播放时间长度?
- 设置listctrl控件风格中选择了LVSCW_AUTOSIZE,如何去掉report型listctrl每行字的下划线???
- 为什么我定义的成员变量 编译器会说undefined
- 兄弟们,一个熟悉MFC C++的程序员在深圳值多少钱阿
- 请问哪里可以找到软件水平考试的资料?
- why,why?
- ***请问:这。。。怎么办?*****************
- 看VC++深入详解 这本书,非得要学C++吗?
- 输入法鼠标输入问题。
这个应该跟您<mmsystem.h>里的内容有关系
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
相关的东西,如果你放在后边可能引起重复包含,这样会出错的,系统在编译的时候会把头文件内容嵌到源文件里面去,一旦你重复包含就会报错,你可以用#pragma once 来取消重复包含的错误。
还有头文件包含有时候还有先后的关系,有时候如果先调一个头文件,在调另一个,那么这两个头文件就必须有先后关系