ICustomQueryInterface.GetInterface(Guid, IntPtr) ICustomQueryInterface.GetInterface(Guid, IntPtr) ICustomQueryInterface.GetInterface(Guid, IntPtr) ICustomQueryInterface.GetInterface(Guid, IntPtr) Method

定义

根据指定的接口 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 :  *  -> System.Runtime.InteropServices.CustomQueryInterfaceResult
Public Function GetInterface (ByRef iid As Guid, ByRef ppv As IntPtr) As CustomQueryInterfaceResult

参数

iid
Guid Guid Guid Guid

请求的接口的 GUID。The GUID of the requested interface.

ppv
IntPtr IntPtr IntPtr 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.

适用于