急急急:关于atl+com实现word插件的问题

wangyanfeng52 2008-07-11 07:44:02
谁能帮我解释一下下面错误的意思以及如何改正,小妹实在是不胜感激啊。


Compiling...
Addin.cpp
d:\wyf的文件夹\vc++\wordaddin\addin.h(39) : error C2440: 'initializing' : cannot convert from 'const int' to 'const struct _GUID *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
d:\wyf的文件夹\vc++\wordaddin\addin.h(39) : error C2065: '_atl_event_classtype' : undeclared identifier
d:\wyf的文件夹\vc++\wordaddin\addin.h(39) : error C2059: syntax error : ')'
d:\wyf的文件夹\vc++\wordaddin\addin.h(39) : error C2143: syntax error : missing '(' before ')'
d:\wyf的文件夹\vc++\wordaddin\addin.h(39) : error C2653: '_atl_event_classtype' : is not a class or namespace name
d:\wyf的文件夹\vc++\wordaddin\addin.h(39) : error C2645: no qualified name for pointer to member (found ':: *')
d:\wyf的文件夹\vc++\wordaddin\addin.h(39) : error C2143: syntax error : missing ';' before ','
d:\wyf的文件夹\vc++\wordaddin\addin.h(40) : error C2143: syntax error : missing ';' before '{'
d:\wyf的文件夹\vc++\wordaddin\addin.h(40) : error C2447: missing function header (old-style formal list?)
d:\wyf的文件夹\vc++\wordaddin\addin.h(40) : error C2143: syntax error : missing ';' before '}'
d:\wyf的文件夹\vc++\wordaddin\addin.h(40) : error C2143: syntax error : missing ';' before 'return'
d:\wyf的文件夹\vc++\wordaddin\addin.h(40) : error C2143: syntax error : missing ';' before '}'
d:\wyf的文件夹\vc++\wordaddin\addin.h(52) : error C2143: syntax error : missing ';' before '{'
d:\wyf的文件夹\vc++\wordaddin\addin.h(52) : error C2447: missing function header (old-style formal list?)
d:\wyf的文件夹\vc++\wordaddin\addin.h(236) : error C2653: 'CommandBarButtonEvents' : is not a class or namespace name
d:\wyf的文件夹\vc++\wordaddin\addin.h(236) : error C2065: 'DispEventUnadivise' : undeclared identifier
d:\wyf的文件夹\vc++\wordaddin\addin.h(236) : error C2065: 'm_spButton' : undeclared identifier
D:\wyf的文件夹\vc++\WordAddin\Addin.cpp(29) : error C2955: 'CComQIPtr' : use of class template requires template argument list
c:\program files\microsoft visual studio\vc98\atl\include\atlbase.h(715) : see declaration of 'CComQIPtr'
D:\wyf的文件夹\vc++\WordAddin\Addin.cpp(29) : error C2514: 'ATL::CComQIPtr' : class has no constructors
c:\program files\microsoft visual studio\vc98\atl\include\atlbase.h(715) : see declaration of 'CComQIPtr'
D:\wyf的文件夹\vc++\WordAddin\Addin.cpp(29) : error C2262: 'pCommandBarButton' : cannot be destroyed
D:\wyf的文件夹\vc++\WordAddin\Addin.cpp(32) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'char [16]' to 'const unsigned short *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
WordAddin.cpp
d:\wyf的文件夹\vc++\wordaddin\addin.h(39) : error C2440: 'initializing' : cannot convert from 'const int' to 'const struct _GUID *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
d:\wyf的文件夹\vc++\wordaddin\addin.h(39) : error C2065: '_atl_event_classtype' : undeclared identifier
d:\wyf的文件夹\vc++\wordaddin\addin.h(39) : error C2059: syntax error : ')'
d:\wyf的文件夹\vc++\wordaddin\addin.h(39) : error C2143: syntax error : missing '(' before ')'
d:\wyf的文件夹\vc++\wordaddin\addin.h(39) : error C2653: '_atl_event_classtype' : is not a class or namespace name
d:\wyf的文件夹\vc++\wordaddin\addin.h(39) : error C2645: no qualified name for pointer to member (found ':: *')
d:\wyf的文件夹\vc++\wordaddin\addin.h(39) : error C2143: syntax error : missing ';' before ','
d:\wyf的文件夹\vc++\wordaddin\addin.h(40) : error C2143: syntax error : missing ';' before '{'
d:\wyf的文件夹\vc++\wordaddin\addin.h(40) : error C2447: missing function header (old-style formal list?)
d:\wyf的文件夹\vc++\wordaddin\addin.h(40) : error C2143: syntax error : missing ';' before '}'
d:\wyf的文件夹\vc++\wordaddin\addin.h(40) : error C2143: syntax error : missing ';' before 'return'
d:\wyf的文件夹\vc++\wordaddin\addin.h(40) : error C2143: syntax error : missing ';' before '}'
d:\wyf的文件夹\vc++\wordaddin\addin.h(52) : error C2143: syntax error : missing ';' before '{'
d:\wyf的文件夹\vc++\wordaddin\addin.h(52) : error C2447: missing function header (old-style formal list?)
d:\wyf的文件夹\vc++\wordaddin\addin.h(236) : error C2653: 'CommandBarButtonEvents' : is not a class or namespace name
d:\wyf的文件夹\vc++\wordaddin\addin.h(236) : error C2065: 'DispEventUnadivise' : undeclared identifier
d:\wyf的文件夹\vc++\wordaddin\addin.h(236) : error C2065: 'm_spButton' : undeclared identifier
D:\wyf的文件夹\vc++\WordAddin\WordAddin.cpp(41) : error C2248: 'UpdateRegistry' : cannot access private member declared in class 'CAddin'
d:\wyf的文件夹\vc++\wordaddin\addin.h(29) : see declaration of 'UpdateRegistry'
Generating Code...
执行 cl.exe 时出错.

WordAddin.dll - 1 error(s), 0 warning(s)
...全文
116 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
yuhh666 2008-07-17
  • 打赏
  • 举报
回复
估计是头文件没有引用全吧
dbger 2008-07-14
  • 打赏
  • 举报
回复
可能是例子代码使用的VC版本与你使用的不一致的原因

3,245

社区成员

发帖
与我相关
我的任务
社区描述
ATL,Active Template Library活动(动态)模板库,是一种微软程序库,支持利用C++语言编写ASP代码以及其它ActiveX程序。
社区管理员
  • ATL/ActiveX/COM社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧