ICustomQueryInterface 介面
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
警告
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-table 佈局,且 InterfaceTypeAttribute 其 為 InterfaceIsIUnknown。
方法
| 名稱 | Description |
|---|---|
| GetInterface(Guid, IntPtr) |
已淘汰.
根據指定的介面 ID 回傳介面。 |