WTL add to MFC

1.  加头
#ifndef STRICT
#define STRICT
#endif
#define WIN32_LEAN_AND_MEAN

#ifndef WINVER
//Allow use of features specific to Windows 95 and Windows NT 4 or later.
#define WINVER 0x0500
#endif

#ifndef _WIN32_WINNT
//Allow use of features specific to Windows NT 4 or later.
#define _WIN32_WINNT 0x0501
#endif


#ifndef _WIN32_WINDOWS
//Allow use of features specific to Windows 98 or later.
#define _WIN32_WINDOWS 0x0510 //Change this to the appropriate value to target Windows Me or later.
#endif

#ifndef _WIN32_IE
//Allow use of features specific to IE 4.0 or later.
#define _WIN32_IE 0x0501
#endif

#define _RICHEDIT_VER 0x0200

#define _ATL_APARTMENT_THREADED
#define _ATL_NO_AUTOMATIC_NAMESPACE
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS //some CString constructors will be explicit
#define _ATL_ALL_WARNINGS //turns off ATL's hiding of some common and often safely ignored warning messages


#include
<objidl.h> // include objidl.h for __IStream_INTERFACE_DEFINED__
#undef _WINDOWS_ // Add this line to prevent MFC from complaining about windows.h included already


#include
<afxwin.h>
//////////////////////////////////////////////////////////////////////////
#include <atlbase.h>
#include
<atlcom.h>

#define _WTL_NO_AUTOMATIC_NAMESPACE // Add this line so you won't get ambiguous symbol errors..

#include
<atlapp.h>
#include
<atlwin.h>
#include
<atlmisc.h>
#include
<atlframe.h>
#include
<atlctrls.h>
#include
<atldlgs.h>
#include
<atlctrlw.h>

using namespace ATL;
2. 右键工程, 添加类, 任意atl相关。  确定添加ATL支持

posted on 2011-04-08 15:13  oleeceo  阅读(401)  评论(0)    收藏  举报

导航