![](https://qzs.qzone.qq.com/ac/b.gif)
最近将以前WTL的例子拿出来重新编译学习时,出现很多错误,经过摸索,终于解决,以备忘。
一、字符串相关的编译错误:
将#include <atlstr.h>//放在stdafx.h中的最前面,否则会出现冲突,找不到CString定义
一、字符串相关的编译错误:
将#include <atlstr.h>//放在stdafx.h中的最前面,否则会出现冲突,找不到CString定义
二、很多类找不到,如CLogFont,主要是WTL在高版本中已经定义,修改老的wtl空间为另一个名称空间,如WTL_My;
然后在stdafx.h中加上
using namespace WTL_My;
然后在stdafx.h中加上
using namespace WTL_My;
三、error C2039: “GetMonitorInfo”: 不是“`global namespace'”的成员 C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\include\atlwin.h 2097 1 Simple Demo
error C2039: “MonitorFromWindow”: 不是“`global namespace&
error C2039: “MonitorFromWindow”: 不是“`global namespace&