【发布时间】:2014-01-05 03:20:50
【问题描述】:
我在使用 WIN32OLE#ole_query_interface 函数时遇到问题。
我使用相同的源代码,如doc of the function:
ie = WIN32OLE.new('InternetExplorer.Application')
ie_web_app = ie.ole_query_interface('{0002DF05-0000-0000-C000-000000000046}')
puts "ie_web_app: = #{ie_web_app.ole_type}"
输出是:
# => ie_web_app: = IWebBrowser2
但我希望输出是 IWebBrowserApp。我错过了什么?
顺便说一句:我正在开发 64 位 Win7,我现在使用 2 个解释器进行测试:
- 红宝石 2.0.0 p353 (2013-11-22) [x64-mingw32]
- 红宝石 1.9.3 p484 (2013-11-22) [i386-mingw32]
这是来自 tlb 的 coclass 供参考:
uuid(0002DF01-0000-0000-C000-000000000046), helpstring("Internet Explorer Application.") ] coclass InternetExplorer {
[default] interface IWebBrowser2;
interface IWebBrowserApp;
[default, source] dispinterface DWebBrowserEvents2;
[source] dispinterface DWebBrowserEvents; };
以及IWebBrowserApp的相关部分:
[
uuid(0002DF05-0000-0000-C000-000000000046),
helpstring("Web Browser Application Interface."),
hidden,
dual
]
dispinterface IWebBrowserApp {
【问题讨论】:
-
我不知道 Ruby,puts 的第一部分及其结果对我来说是可疑的。确定是同一条
puts行吗? -
@Medinoc 谢谢 - 我现在已经纠正了这个问题(我不小心从测试中复制了错误的行) - 但输出类型仍然相同。