ICLRRuntimeInfo::GetInterface Method

.NET Framework (current version)
 

Loads the CLR into the current process and returns runtime interface pointers, such as ICLRRuntimeHost, ICLRStrongName, and IMetaDataDispenserEx.

This method supersedes all the CorBindTo* functions in the Deprecated CLR Hosting Functions section.

HRESULT GetInterface(  
[in]  REFCLSID rclsid,  
[in]  REFIID   riid,  
[out, iid_is(riid), retval] LPVOID *ppUnk);  

Parameters

rclsid
[in] The CLSID interface for the coclass.

riid
[in] The IID of the requested rclsid interface.

ppUnk
[out] A pointer to the queried interface.

This method returns the following specific HRESULTs as well as HRESULT errors that indicate method failure.

HRESULTDescription
S_OKThe method completed successfully.
E_POINTERppUnk is null.
E_OUTOFMEMORYNot enough memory is available to handle the request.
CLR_E_SHIM_LEGACYRUNTIMEALREADYBOUNDA different runtime was already bound to the legacy CLR version 2 activation policy.

This method causes the CLR to be loaded but not initialized.

The following table shows the supported combinations for rclsid and riid.

rclsidriid
CLSID_CorMetaDataDispenserIID_IMetaDataDispenser, IID_IMetaDataDispenserEx
CLSID_CorMetaDataDispenserRuntimeIID_IMetaDataDispenser, IID_IMetaDataDispenserEx
CLSID_CorRuntimeHostIID_ICorRuntimeHost
CLSID_CLRRuntimeHostIID_ICLRRuntimeHost
CLSID_TypeNameFactoryIID_ITypeNameFactory
CLSID_CLRDebuggingLegacyIID_ICorDebug
CLSID_CLRStrongNameIID_ICLRStrongName

Platforms: See System Requirements.

Header: MetaHost.h

Library: Included as a resource in MSCorEE.dll

.NET Framework Versions: Available since 4

ICLRRuntimeInfo Interface
Hosting Interfaces
Hosting

Show: