通过


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 表布局,并且其 InterfaceTypeAttributeInterfaceIsIUnknown

方法

名称 说明
GetInterface(Guid, IntPtr)
已过时.

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

适用于