Chinaunix首页 | 论坛 | 博客
  • 博客访问: 605897
  • 博文数量: 138
  • 博客积分: 3067
  • 博客等级: 中校
  • 技术积分: 1565
  • 用 户 组: 普通用户
  • 注册时间: 2008-02-21 12:44
文章分类

全部博文(138)

文章存档

2016年(5)

2014年(4)

2012年(1)

2011年(2)

2010年(10)

2009年(19)

2008年(97)

我的朋友

分类:

2008-07-28 22:27:50

comments about     #define WIN32_LEAN_AND_MEAN

MSDN:
---------------------------------
To speed the build process, Visual C++ provides the following defines that reduce the size of the Win32 header files.

VC_EXTRALEAN

WIN32_LEAN_AND_MEAN

Newly generated Visual C++ AppWizard applications automatically benefit from VC_EXTRALEAN. You can also manually define VC_EXTRALEAN to speed the build process of many legacy MFC applications.

Non-MFC C++ and C applications can define WIN32_LEAN_AND_MEAN and any applicable NOservice defines, such as NOSOUND (see ProgramFiles\Microsoft Visual Studio\VC98\include\Windows.h and ProgramFiles\Microsoft Visual Studio\VC98\MFC\Include\afxv_w32.h), to reduce their build times.

To add these defines, from the Project menu, choose Settings. The Projects settings dialog box appears. Click the C/C++ tab. In the Category list, select Preprocessor. Add the desired definitions to the Preprocessor Definitions box.

MSDN的资料: 
---------------------------------
  为加速生成过程,Visual   C++   提供了如下定义(这些定义通过排除一些不太常用的   API,减小了   Win32   头文件的大小): 
  
  VC_EXTRALEAN 
  WIN32_LEAN_AND_MEAN 
  
  VC_EXTRALEAN  定义 WIN32_LEAN_AND_MEAN 和若干 NOservice 定义,如 NOCOMM 和 NOSOUND。(有关 NOservice 定义列表,请参见头文件 Windows.h 和 MFC 头文件 afxv_w32.h。) 
  
  用 Visual C++ 应用程序向导创建的应用程序自动使用 VC_EXTRALEAN。可以在旧式 MFC 应用程序中手动定义 VC_EXTRALEAN 以加速生成过程。 
  
  非 MFC 应用程序可以定义 WIN32_LEAN_AND_MEAN 和适用的 NOservice 定义以减少生成时间


Note:
use
#define WIN32_LEAN_AND_MEAN
before
#include
when you use some header file like [ DDK ]
can avoid many redefinition error.



在所有的#include 前使用#define WIN32_LEAN_AND_MEAN,如:

#define WIN32_LEAN_AND_MEAN
#include <windows.h>

阅读(1073) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~