已经包含了#include <atlcom.h> #include <comutil.h>还是报错

 在WTL工程的.h中

#include <atlbase.h>
#include <atlcom.h>
#include <atlcomcli.h>
#include <atlctl.h>
#include <atlwin.h>
#include <comutil.h>

结果还是下面一堆错,为什么呢,因为你没有使用这个using namespace ATL; 加上这个下面错全部消失。

error C2061: syntax error : identifier 'CComQIPtr'

 error C2504: 'CWindowImpl' : base class undefined

 error C2065: 'CRegKey' : undeclared identifier

 error C2660: 'SetWindowTextW' : function does not take 1 arguments

 error C2039: 'SubclassWindow' : is not a member of 'xxxxxx'

原文地址:https://www.cnblogs.com/yuzhould/p/4643579.html