ICustomQueryInterface.GetInterface(Guid, IntPtr) 方法

定義

根據指定的介面 ID,傳回介面。Returns an interface according to a specified interface ID.

public:
 System::Runtime::InteropServices::CustomQueryInterfaceResult GetInterface(Guid % iid, [Runtime::InteropServices::Out] IntPtr % ppv);
[System.Security.SecurityCritical]
public System.Runtime.InteropServices.CustomQueryInterfaceResult GetInterface (ref Guid iid, out IntPtr ppv);
abstract member GetInterface : Guid * nativeint -> System.Runtime.InteropServices.CustomQueryInterfaceResult
Public Function GetInterface (ByRef iid As Guid, ByRef ppv As IntPtr) As CustomQueryInterfaceResult

參數

iid
Guid

要求之介面的 GUID。The GUID of the requested interface.

ppv
IntPtr

這個方法傳回時,要求之介面的參考。A reference to the requested interface, when this method returns.

傳回

其中一個列舉值,表示是否已使用 IUnknown::QueryInterface 的自訂實作。One of the enumeration values that indicates whether a custom implementation of IUnknown::QueryInterface was used.

屬性

備註

應用程式可以使用受控碼來指定它自己的自訂介面和標準執行時間介面的執行。An application can use managed code to specify its own implementation for custom interfaces and standard runtime interfaces.

CustomQueryInterfaceResult 傳回值可用來啟用或停用自訂的執行,方法是在 COM 存取期間顯示或隱藏特定的介面。The CustomQueryInterfaceResult return value can be used to enable or disable customized implementations by showing or hiding specific interfaces during COM access.

COM 看不到這個方法。This method is invisible to COM.

安全性

SecurityCriticalAttribute
需要完全信任立即呼叫者。requires full trust for the immediate caller. 部分信任或透明的程式碼無法使用這個成員。This member cannot be used by partially trusted or transparent code.

適用於