在IDL中将IUnknown派生的接口标记为双重的任何意义?

sha*_*oth 5 windows com idl com-interop midl

查看我们的代码我在一个.idl文件中发现了一个好奇的定义:

[
    object,
    uuid(uuidhere),
    dual,
    nonextensible,
    oleautomation,
    hidden
]
interface IOurInterface : IUnknown {
    //methods here
};
Run Code Online (Sandbox Code Playgroud)

如何直接从IUnknown可能是双接口派生的接口?如果我删除dual属性会有什么破坏吗?

sha*_*oth 3

在对有关编组用户的另一个问题的回答中,voice指出了这篇文章,该文章基本上说明了以下内容:

当任何接口(无论是否由 IDispatch 派生)被标记为其中之一dualoleautomation(或两者)时,在调用时都会对其进行特殊处理RegisterTypeLib()(通常由 DllRegisterServer 完成)。对于每个此类接口,都会创建一个 HKCR\Interface{InterfaceId} 键,在该键下,{00020424-0000-0000-C0000-000000000046} 类被引用为代理/存根。该类 id 对应于 typelib marshaller,也称为 oleautomation marshaller。