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.

适用于