COM Outlook 插件功能区按钮在韩语 Outlook 2010 中没有响应
我有一个 COM Outlook 插件,它在 Outlook 2010 中实现了功能区按钮。它已经工作良好一段时间了。直到有人尝试在韩语版 Outlook 中加载该插件。功能区按钮会显示,但单击时不会执行任何操作。在调试器中,每当单击功能区按钮“错误:无法加载类型库。(HRESULT = 0x8002801d)”时,我都会看到下面的错误消息 验证 TypelibID 和指定的主要版本 IDispatchImpl、CStockPropImpl、IProvideClassInfoImpl 或 IProvideCLassInfo2Impl”。
我从未在该按钮的回调中遇到断点,因此我认为我的代码上方的事件层中发生了某些情况。但我不知道是什么,也不知道为什么使用韩语版本的 Outlook 会有所不同。
我认为这与定义我的主插件支持的接口时使用的 LIBID_Office 宏有关:
, public IDispatchImpl<IRibbonExtensibility,
&__uuidof(IRibbonExtensibility),
&LIBID_Office, /* wMajor = */ 2, /* wMinor = */ 4>
该宏定义为
extern "C" const GUID __declspec(selectany) LIBID_Office =
{0x2df8d04c,0x5bfa,0x101b,{0xbd,0xe5,0x00,0xaa,0x00,0x44,0xde,0x52}};
I have a COM Outlook addin which implements a ribbon button in Outlook 2010. It's been working just fine for quite some time. Until someone tried to load the addin in the Korean version of Outlook. The ribbon buttons show up but do not do anything when clicked. In the debugger, I see the error message below whenever I click on the ribbon button "ERROR : Unable to load Typelibrary. (HRESULT = 0x8002801d)
Verify TypelibID and major version specified with
IDispatchImpl, CStockPropImpl, IProvideClassInfoImpl or IProvideCLassInfo2Impl".
I never hit my break point in the callback for this button, so something is going on in the event layer above my code I think. But I don't know what and I don't know why using the Korean version of Outlook should make any different. Anyone have any ideas?
I'm thinking it has something to do with the LIBID_Office macro used below when defining the interfaces my main addin supports:
, public IDispatchImpl<IRibbonExtensibility,
&__uuidof(IRibbonExtensibility),
&LIBID_Office, /* wMajor = */ 2, /* wMinor = */ 4>
The macro is defined as
extern "C" const GUID __declspec(selectany) LIBID_Office =
{0x2df8d04c,0x5bfa,0x101b,{0xbd,0xe5,0x00,0xaa,0x00,0x44,0xde,0x52}};
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
失败的类型库查找是 COM 插件自己的类型库。 ProcMon 显示 Korean Outlook 尝试从 HKCR 获取类型库但失败。它没有理由失败,我可以在 regedit 中的 HKCR 键下清楚地看到注册。
正如我之前所说,我的插件是为当前用户安装的,因此所有注册都在“HKCU\Software\Classes”下完成。
当我侵入“HKLM\Software\Classes”下的类型库的注册表项时,韩语 Outlook 突然发现一切正常并且插件可以正常工作。
当插件启动时,我将让它在 HKLM 下创建 typelib 条目。这是一个 hack,但我不知道在 HKCR 中查找条目时,MS 让 Outlook 用韩语(可能是其他语言?)做什么。
The typelib lookup it is failing on is the COM addin's own typelib. ProcMon shows Korean Outlook trying to get the typelib from HKCR and failing. There's no reason why it should fail, I can see the registration clearly in regedit under the HKCR key.
As I said before, my addin is installed for current user, so all registrations get done under "HKCU\Software\Classes".
When I hack in a registry entry for my typelib under "HKLM\Software\Classes", suddenly Korean Outlook finds everything fine and the addin works.
When the addin starts up, I'm just going to have it create the typelib entry under HKLM. It's a hack, but I don't know what the heck MS is having Outlook do in Korean (possibly other languages?) when looking up entries in HKCR.