WTL和ATL中CString冲突
2014-05-05 15:47
309 查看
WTL和ATL、MFC都有各自的CString类,类名相同,功能也都差不多,但是如果你同时用到了WTL和ATL,就会发生CString冲突的问题,从而编译器会报错,因为编译器不知道到底你要用的CString是哪个类。下面提供一组头文件包含的内容及顺序,如果你用到ATL和WTL,只要把下面这几行放到stdafx.h中,就搞定了。
#include <atlbase.h>
#include <atlstr.h>
#include <atlwin.h>
#include <atlapp.h>
#define _WTL_NO_CSTRING
#include <atlmisc.h>
#include <atlcom.h>
#include <atlframe.h>
#include <atlctrls.h>
#include <atldlgs.h>
#include <atlbase.h>
#include <atlstr.h>
#include <atlwin.h>
#include <atlapp.h>
#define _WTL_NO_CSTRING
#include <atlmisc.h>
#include <atlcom.h>
#include <atlframe.h>
#include <atlctrls.h>
#include <atldlgs.h>
相关文章推荐
- 混用ATL MFC WTL的问题-CString的冲突
- 混用ATL MFC WTL的问题-CString的冲突
- wtl和atl的CString冲突时怎么办
- ATL、MFC、WTL CString 的今生前世
- WTL中CString CPoint等出现冲突的问题
- WTL/ATL CString CStringA 到 char *
- 简单解决 ATL:CString WTL:CString 冲突
- ATL、MFC、WTL CString 的今生前世
- ATL、MFC、WTL CString 的今生前世
- WTL\MFC\ATL CSTRING的前世今生
- 解决不能从 WTL::CString 转换为 ATL::CSimpleString & 的问题
- ATL与WTL中CString的使用, 利用ATLCString获得窗口的文字.
- 【转】剖析ATL\WTL\CSTRING的实现
- ATL、MFC、WTL CString 的今生前世
- 简单解决 ATL:CString WTL:CString 冲突
- ATL、MFC、WTL CString 的今生前世
- ATL与WTL中CString的使用, 利用ATLCString获得窗口的文字.
- 解决WTL和ATL命名冲突
- ATL 与WTL使用CString 的文件声明
- ATL、MFC、WTL CString 的今生前世