ICustomQueryInterface ICustomQueryInterface ICustomQueryInterface ICustomQueryInterface Interface

定义

警告

此 API 现已过时。

允许开发人员提供 IUnknown::QueryInterface(REFIID riid, void **ppvObject) 方法的自定义托管实现。Enables developers to provide a custom, managed implementation of the IUnknown::QueryInterface(REFIID riid, void **ppvObject) method.

public interface class ICustomQueryInterface
[System.Runtime.InteropServices.ComVisible(false)]
[System.Obsolete("ICustomQueryInterface may be unavailable in future releases.")]
public interface ICustomQueryInterface
type ICustomQueryInterface = interface
Public Interface ICustomQueryInterface
属性

注解

此类允许高级的用户提供的自定义托管的实现QueryInterface方法。This class permits advanced users to provide a customized managed implementation of the QueryInterface method.

托管和本机应用程序可以使用自定义的实现指定的接口 id,除了 IID_IUnknown 返回特定的接口。Managed and native applications can use the customized implementation to return a specific interface for a specified interface ID, except for IID_IUnknown. 也就是说,当QueryInterface是调用,它将忽略自定义实现如果其riid参数设置为 IID_IUnknown。That is, when QueryInterface is called, it will ignore custom implementations if its riid parameter is set to IID_IUnknown. 但是,仍可能会返回IUnknown作为ppvObjectHowever, you may still return IUnknown as the ppvObject.

开发人员可以提供所有接口的自定义实现 (除IUnknown) 如果他们定义和实现有效的相应接口。Developers can provide custom implementations for all interfaces (except for IUnknown) if they define and implement a valid corresponding interface.

一个有效的用户定义的接口具有 v 表布局完全匹配的非托管的 COM 接口,并将其InterfaceTypeAttributeInterfaceIsIUnknownA valid user-defined interface has a v-table layout that matches the unmanaged COM interface exactly, and its InterfaceTypeAttribute is InterfaceIsIUnknown.

方法

GetInterface(Guid, IntPtr) GetInterface(Guid, IntPtr) GetInterface(Guid, IntPtr) GetInterface(Guid, IntPtr)

根据指定的接口 ID 返回接口。Returns an interface according to a specified interface ID.

适用于