转:WIN32_LEAN_AND_MEAN 宏的作用

#define WIN32_LEAN_AND_MEAN

 

Non-MFC C++ and C applications can define WIN32_LEAN_AND_MEAN and any applicable NOservicedefines, 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.

 通过在定义该宏来减小WIN32头文件的大小,定义该宏可以屏蔽掉如下代码(在Windows.h)中被定义:

 

#ifndef WIN32_LEAN_AND_MEAN
#include <cderr.h>
#include <dde.h>
#include <ddeml.h>
#include <dlgs.h>
#ifndef _MAC
#include <lzexpand.h>
#include <mmsystem.h>
#include <nb30.h>
#include <rpc.h>
#endif
#include <shellapi.h>
#ifndef _MAC
#include <winperf.h>

#if(_WIN32_WINNT >= 0x0400)
#include <winsock2.h>
#include <mswsock.h>
#else
#include <winsock.h>
#endif /* _WIN32_WINNT >=  0x0400 */

#endif
#ifndef NOCRYPT
#include <wincrypt.h>
#endif

#ifndef NOGDI
#include <commdlg.h>
#ifndef _MAC
#include <winspool.h>
#ifdef INC_OLE1
#include <ole.h>
#else
#include <ole2.h>
#endif /* !INC_OLE1 */
#endif /* !MAC */
#endif /* !NOGDI */
#endif /* WIN32_LEAN_AND_MEAN */

 

原文链接:http://blog.csdn.net/jeanwaljean/article/details/5967573

原文地址:https://www.cnblogs.com/watermoon/p/3053151.html