ATL写OFFICE插件的问题??急求大虾帮助!

infosecurity 2008-04-28 04:15:18
新建立的一个ATL工程 用了_IDTExtensibility2接口 在#import了这几个文件后
#import "C:\\Program Files\\Common Files\\Microsoft Shared\\OFFICE11\\mso.dll" \
rename_namespace("Office") named_guids,exclude("Pages")
using namespace Office;
#import "C:\\Program Files\\Common Files\\Microsoft Shared\\VBA\\VBA6\\VBE6EXT.olb" rename_namespace("VBE6")
using namespace VBE6;

#import "D:\\tools\\office\\OFFICE11\\MSWORD.OLB" rename("ExitWindows","ExitWindowsEx")

#import "D:\\tools\\office\\OFFICE11\\MSWORD.OLB" \
rename_namespace("Word") raw_interfaces_only, named_guids ,exclude("Pages")
using namespace Word;

在编译的时候出现了
Compiling...
StdAfx.cpp
e:\test\wordaddin\debug\mso.tlh(1089) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
e:\test\wordaddin\debug\vbe6ext.tlh(212) : error C2146: syntax error : missing ';' before identifier 'CommandBars'
e:\test\wordaddin\debug\vbe6ext.tlh(212) : error C2501: '__missing_type__' : missing storage-class or type specifiers
e:\test\wordaddin\debug\vbe6ext.tlh(212) : error C2208: 'struct Office::CommandBars' : no members defined using this type
e:\test\wordaddin\debug\vbe6ext.tlh(233) : error C2146: syntax error : missing ';' before identifier 'GetCommandBars'
e:\test\wordaddin\debug\vbe6ext.tlh(233) : error C2501: '__missing_type__' : missing storage-class or type specifiers
e:\test\wordaddin\debug\vbe6ext.tlh(255) : error C2061: syntax error : identifier '__missing_type__'
e:\test\wordaddin\debug\vbe6ext.tli(32) : error C2143: syntax error : missing ';' before 'tag::id'
e:\test\wordaddin\debug\vbe6ext.tli(32) : error C2433: '__missing_type__' : 'inline' not permitted on data declarations
e:\test\wordaddin\debug\vbe6ext.tli(32) : error C2501: '__missing_type__' : missing storage-class or type specifiers
e:\test\wordaddin\debug\vbe6ext.tli(32) : fatal error C1004: unexpected end of file found
Error executing cl.exe.

wordaddin.dll - 10 error(s), 1 warning(s)

我用的VC6。0 求高手帮助啊!!
...全文
223 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
worry_js 2009-09-11
  • 打赏
  • 举报
回复
[Quote=引用 9 楼 infosecurity 的回复:]
我重装了系统 再装了office和vc就好了。。。。- -!
[/Quote] 好舍得!
infosecurity 2008-04-30
  • 打赏
  • 举报
回复
但是这个程序在别人的机子上都可以成功呢。。
UltraBejing 2008-04-30
  • 打赏
  • 举报
回复
这个简单啊,网上搜一下就得到答案了.
infosecurity 2008-04-30
  • 打赏
  • 举报
回复
问题已经解决了哈, 我重装了系统 再装了office和vc就好了。。。。- -!
sunmz_wjxy 2008-04-29
  • 打赏
  • 举报
回复
Office重装一遍试试.
infosecurity 2008-04-29
  • 打赏
  • 举报
回复
还是不行,我就是学习了VCKbase上面的那片文章学者做的,但是不知道怎么老是出问题呢。。。都快把我整疯了。。。
不知道是不是我装的office或者是VC有问题呢?
infosecurity 2008-04-29
  • 打赏
  • 举报
回复
我试试。。
jameshooo 2008-04-29
  • 打赏
  • 举报
回复
office的类型库有些问题,部分符号无法导出,部分符号跟系统符号有冲突,解决办法就是符号改名,或者排除这些符号的导出
sunmz_wjxy 2008-04-28
  • 打赏
  • 举报
回复
或者楼主可以看一下这个
http://www.vckbase.com/document/viewdoc/?id=1737
sunmz_wjxy 2008-04-28
  • 打赏
  • 举报
回复
#import "C:\\Program Files\\Microsoft Office\\Office11\\MSO9.DLL" rename_namespace("Office")
using namespace Office;
#import "C:\\Program Files\\Common Files\\Microsoft Shared\\VBA\\VBA6\\VBE6EXT.olb" rename_namespace("VBE6")
using namespace VBE6;
#import D:\\tools\\office\\OFFICE11\\MSWORD.OLB" rename("ExitWindows","ExitWindowsEx"),named_guids,rename_namespace("MSWord")
using namespace MSWord;


如果还是不行就把工程的DSW等一些文件删掉,在重新Build
infosecurity 2008-04-28
  • 打赏
  • 举报
回复
我刚学这个一直没弄懂是怎么回事。。。忘指点。

3,248

社区成员

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

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