RuntimeEnvironment.GetRuntimeInterfaceAsObject(Guid, Guid) 方法

定义

注意

RuntimeEnvironment members SystemConfigurationFile, GetRuntimeInterfaceAsIntPtr, and GetRuntimeInterfaceAsObject are not supported and throw PlatformNotSupportedException.

返回通过指向其 IUnknown 接口的指针表示 COM 对象的类型实例。

public:
 static System::Object ^ GetRuntimeInterfaceAsObject(Guid clsid, Guid riid);
public static object GetRuntimeInterfaceAsObject (Guid clsid, Guid riid);
[System.Obsolete("RuntimeEnvironment members SystemConfigurationFile, GetRuntimeInterfaceAsIntPtr, and GetRuntimeInterfaceAsObject are not supported and throw PlatformNotSupportedException.", DiagnosticId="SYSLIB0019", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public static object GetRuntimeInterfaceAsObject (Guid clsid, Guid riid);
[System.Runtime.InteropServices.ComVisible(false)]
[System.Security.SecurityCritical]
public static object GetRuntimeInterfaceAsObject (Guid clsid, Guid riid);
static member GetRuntimeInterfaceAsObject : Guid * Guid -> obj
[<System.Obsolete("RuntimeEnvironment members SystemConfigurationFile, GetRuntimeInterfaceAsIntPtr, and GetRuntimeInterfaceAsObject are not supported and throw PlatformNotSupportedException.", DiagnosticId="SYSLIB0019", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
static member GetRuntimeInterfaceAsObject : Guid * Guid -> obj
[<System.Runtime.InteropServices.ComVisible(false)>]
[<System.Security.SecurityCritical>]
static member GetRuntimeInterfaceAsObject : Guid * Guid -> obj
Public Shared Function GetRuntimeInterfaceAsObject (clsid As Guid, riid As Guid) As Object

参数

clsid
Guid

所需类的标识符。

riid
Guid

所需接口的标识符。

返回

一个对象,表示指定的非托管 COM 对象。

属性

例外

仅限 .NET Core 和 .NET 5 及更高版本:在所有情况下。

注解

GetRuntimeInterfaceAsObject 类似于 GetRuntimeInterfaceAsIntPtr 方法。

适用于