在IDL中将IUnknown派生接口标记为双精度的任何意义? [英] Any sense in marking an IUnknown-derived interface as dual in IDL?

查看:263
本文介绍了在IDL中将IUnknown派生接口标记为双精度的任何意义?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

查看代码我在其中一个.idl文件中找到了一个好奇的定义:

Reviewing our code I've found a curious definition in one of .idl files:

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

如何直接从 IUnknown派生的接口可能是双界面?如果我删除 dual 属性,会有什么中断?

How can an interface derived directly from IUnknown possibly be a dual interface? Will anything break if I remove the dual attribute?

推荐答案

a href =http://stackoverflow.com/questions/1720689/how-does-com-select-how-to-marshal-an-interface/1741721#1741721>这个回答到另一个有关封送的问题用户voyce 指向这篇文章基本上说明了以下内容:

In this answer to another question concerning marshaling user voyce points to this article that basically states the following:

当任何接口(IDispatch派生或不是) dual oleautomation (或两者)特别处理 RegisterTypeLib c $ c>(通常由DllRegisterServer完成)。对于每个这样的接口,创建HKCR \Interface {InterfaceId}密钥,在该密钥下,{00020424-0000-0000-C0000-000000000046}类被引用为代理/存根。这个类id对应于typelib marshaller也称为oleautomation marshaller。

When any interface (IDispatch-derived or not) is marked either dual or oleautomation (or both) it is treated specially when RegisterTypeLib() is invoked (which is typically done by DllRegisterServer). For each such interface an HKCR\Interface{InterfaceId} key is created under which {00020424-0000-0000-C0000-000000000046} class is referenced as proxy/stub. This class id corresponds to typelib marshaller also known as oleautomation marshaller.

这篇关于在IDL中将IUnknown派生接口标记为双精度的任何意义?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆