我在MFC程序中使用ComObject,结果出现这种错误,大家来看看该如何解决?谢谢!
XMLCOM.cpp
d:\program files\microsoft visual studio\vc98\atl\include\atlcom.h(2945) : error C2065: '_Module' : undeclared identifier
d:\program files\microsoft visual studio\vc98\atl\include\atlcom.h(2945) : error C2228: left of '.Lock' must have class/struct/union type
d:\program files\microsoft visual studio\vc98\atl\include\atlcom.h(2947) : error C2228: left of '.Unlock' must have class/struct/union type
d:\program files\microsoft visual studio\vc98\atl\include\atlcom.h(3318) : error C2228: left of '.m_csTypeInfoHolder' must have class/struct/union type
d:\program files\microsoft visual studio\vc98\atl\include\atlcom.h(3344) : error C2228: left of '.m_csTypeInfoHolder' must have class/struct/union type
d:\program files\microsoft visual studio\vc98\atl\include\atlcom.h(3345) : error C2228: left of '.AddTermFunc' must have class/struct/union type
d:\cbn_project\cbn\xmlcom.h(38) : error C2955: 'CComObject' : use of class template requires template argument list
d:\program files\microsoft visual studio\vc98\atl\include\atlcom.h(2432) : see declaration of 'CComObject'
d:\cbn_project\cbn\xmlcom.h(38) : fatal error C1903: unable to recover from previous error(s); stopping compilation
Error executing cl.exe.
问题点数:0、回复次数:1Top
1 楼jiangsheng(蒋晟.Net[MVP])回复于 2005-04-04 03:59:06 得分 0
关闭所有打开的文件;在ClassView中右键单击工程名,选择Add->New ATL Object,在确认添加ATL支持时选择确定,然后不选择任何对象,直接取消,然后重新编译Top




