Бөлісу құралы:


RuntimeEnvironment.GetRuntimeInterfaceAsIntPtr(Guid, Guid) Метод

Определение

Внимание!

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

Возвращает указанный интерфейс для указанного класса.

public:
 static IntPtr GetRuntimeInterfaceAsIntPtr(Guid clsid, Guid riid);
public static IntPtr GetRuntimeInterfaceAsIntPtr (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 IntPtr GetRuntimeInterfaceAsIntPtr (Guid clsid, Guid riid);
[System.Runtime.InteropServices.ComVisible(false)]
[System.Security.SecurityCritical]
public static IntPtr GetRuntimeInterfaceAsIntPtr (Guid clsid, Guid riid);
static member GetRuntimeInterfaceAsIntPtr : Guid * Guid -> nativeint
[<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 GetRuntimeInterfaceAsIntPtr : Guid * Guid -> nativeint
[<System.Runtime.InteropServices.ComVisible(false)>]
[<System.Security.SecurityCritical>]
static member GetRuntimeInterfaceAsIntPtr : Guid * Guid -> nativeint
Public Shared Function GetRuntimeInterfaceAsIntPtr (clsid As Guid, riid As Guid) As IntPtr

Параметры

clsid
Guid

Идентификатор требуемого класса.

riid
Guid

Идентификатор требуемого интерфейса.

Возвращаемое значение

IntPtr

nativeint

Неуправляемый указатель на запрашиваемый интерфейс.

Атрибуты

Исключения

Только .NET Core и .NET 5+: Во всех случаях.

Комментарии

В следующей таблице показаны поддерживаемые сочетания для clsid и riid.

clsid riid
CLSID_CorMetaDataDispenser IID_IMetaDataDispenser, IID_IMetaDataDispenserEx
CLSID_CorMetaDataDispenserRuntime IID_IMetaDataDispenser, IID_IMetaDataDispenserEx
CLSID_CorRuntimeHost IID_CorRuntimeHost
CLSID_CLRRuntimeHost IID_CLRRuntimeHost (недопустимо для среды CLR, предоставляемой платформой .NET Framework 4), IID_CLRRuntimeHost3
CLSID_TypeNameFactory IID_TypeNameFactory
CLSID_CLRStrongName IID_CLRStrongName

GetRuntimeInterfaceAsIntPtr аналогичен методу GetRuntimeInterfaceAsObject .

Применяется к