如何访问通过COM InterOp公开多个接口的CoClass?

时间:2013-02-08 09:37:32

标签: com com-interop typelib midl tlbimp

我有一个CoClass,描述如下:

[
    uuid(xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx), 
    version(1.0), 
    helpstring("FooBar")
]
coclass FooBar
{
    [default] interface IFoo;
    interface IBar;
}

所以我的问题是:

  1. 为什么tlbimp只公开IFoo界面,而oleview.exe显示两个界面?
  2. tlbimp仅公开[default]接口,为什么? (根据MSDN [default] “仅供宏语言使用。”
  3. 如何在MIDL / COM中对此案例进行建模?我应该使用关联而不是继承吗?

0 个答案:

没有答案
相关问题