远安县旧县镇:请教VC++6.0

来源:百度文库 编辑:神马品牌网 时间:2024/04/28 16:28:14
谁知道stdafx.h的源代码

没那么多吧?不就这么点:
// 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__7330DD18_AF94_4502_9032_2568D875BF15__INCLUDED_)
#define AFX_STDAFX_H__7330DD18_AF94_4502_9032_2568D875BF15__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers

#include <stdio.h>

// TODO: reference additional headers your program requires here

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_STDAFX_H__7330DD18_AF94_4502_9032_2568D875BF15__INCLUDED_)

自己看啊,VC++工程编译后包含的文件里有的
好像是一些头文件的包含

// 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__160916C4_62ED_4814_9F2B_8F423958960D__INCLUDED_)
#define AFX_STDAFX_H__160916C4_62ED_4814_9F2B_8F423958960D__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 <afxole.h> // MFC OLE classes
#include <afxodlgs.h> // MFC OLE dialog classes
#include <afxdisp.h> // MFC Automation classes

#ifndef _AFX_NO_DB_SUPPORT
#include <afxdb.h> // MFC ODBC database classes
#endif // _AFX_NO_DB_SUPPORT

#ifndef _AFX_NO_DAO_SUPPORT
#include <afxdao.h> // MFC DAO database classes
#endif // _AFX_NO_DAO_SUPPORT

#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

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_STDAFX_H__160916C4_62ED_4814_9F2B_8F423958960D__INCLUDED_)

stdafx.h和stdafx.cpp都是VC在建立工程时自动生成的,主要的用处是预编译头文件。预编译可以在第一次编译的时候生成一个固定的头文件(.PCH),他的内容相对固定,不会更改,下次编译的时候,VC会直接使用它,不用再次编译原来的文件,使你以后能更快的编译工程。你可以把要用的windows头文件放在里面。VC在建不同的工程时会根据不同的需要加入需要的头文件。