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 資料表版面配置,且其 InterfaceTypeAttributeInterfaceIsIUnknown

方法

GetInterface(Guid, IntPtr)
已淘汰.

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

適用於