ICustomQueryInterface 介面

定義

警告

ICustomQueryInterface may be unavailable in future releases.

讓開發人員提供 IUnknown::QueryInterface(REFIID riid, void **ppvObject) 方法的自訂 Managed 實作。

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
屬性

備註

這個類別可讓進階使用者提供 方法的自定義 Managed 實作 QueryInterface

受控和原生應用程式可以使用自定義實作傳回指定介面標識碼的特定介面,但IID_IUnknown除外。 也就是說,呼叫 時 QueryInterface ,如果參數 riid 設定為 IID_IUnknown,則會忽略自定義實作。 不過,您仍然可以將 IUnknown 傳回為 ppvObject

開發人員可以在定義及實作有效的對應介面時,提供所有介面的自定義實作 (,但) 除外 IUnknown

有效的使用者定義介面具有與 Unmanaged COM 介面完全相符的 v-table 配置,且其 InterfaceTypeAttributeInterfaceIsIUnknown

方法

GetInterface(Guid, IntPtr)
已淘汰.

根據指定的介面 ID,傳回介面。

適用於