现在的位置: 首页 > 综合 > 正文

WTL库Control

2013年09月11日 ⁄ 综合 ⁄ 共 455字 ⁄ 字号 评论关闭

版权声明:转载时请以超链接形式标明文章原始出处和作者信息及本声明
http://fishmaster.blogbus.com/logs/19251012.html

要用WTL的控件类,需要包含atlctrls.h
#include "atlctrls.h"
如果代码中用到了ATL::CSting,并且包含顺序不合理会产生一个编译错误,好像是说CString不是属于WTL命名空间,这时候要调整包含顺序,正确的包含顺序为:
#include <atlbase.h>
#include <atlcom.h>
#include <atlhost.h>
#include <atlwin.h>
#include <atlctl.h>
#include <atlstr.h>
#include <atlapp.h> // 关键是这个文件不能放atlstr.h前面,因为atlstr.h中定义了一个宏__ATLSTR_H__用来界定CString的命名空间为ATL而不是WTL.

#include <ATLComTime.h>
#include <atlctrls.h>

抱歉!评论已关闭.