ICustomQueryInterface 接口

定义

注意

ICustomQueryInterface may be unavailable in future releases.

允许开发人员提供 IUnknown::QueryInterface(REFIID riid, void **ppvObject) 方法的自定义托管实现。

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

注解

此类允许高级用户提供该方法的 QueryInterface 自定义托管实现。

托管和本机应用程序可以使用自定义实现返回指定接口 ID 的特定接口,但IID_IUnknown除外。 也就是说,调用时 QueryInterface ,如果参数 riid 设置为IID_IUnknown,它将忽略自定义实现。 但是,仍可能返回 IUnknown 作为 。ppvObject

开发人员可以为所有接口提供自定义实现, (,除非 IUnknown) 定义并实现有效的相应接口。

有效的用户定义的接口具有与非托管 COM 接口完全匹配的 v 表布局,并且其 InterfaceTypeAttribute 布局 InterfaceIsIUnknown完全匹配。

方法

GetInterface(Guid, IntPtr)

根据指定的接口 ID 返回接口。

适用于