Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

ICLRRuntimeInfo::GetInterface Method

.NET Framework 4.6 and 4.5

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);

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.

HRESULT

Description

S_OK

The method completed successfully.

E_POINTER

ppUnk is null.

E_OUTOFMEMORY

Not enough memory is available to handle the request.

CLR_E_SHIM_LEGACYRUNTIMEALREADYBOUND

A 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.

rclsid

riid

CLSID_CorMetaDataDispenser

IID_IMetaDataDispenser, IID_IMetaDataDispenserEx

CLSID_CorMetaDataDispenserRuntime

IID_IMetaDataDispenser, IID_IMetaDataDispenserEx

CLSID_CorRuntimeHost

IID_ICorRuntimeHost

CLSID_CLRRuntimeHost

IID_ICLRRuntimeHost

CLSID_TypeNameFactory

IID_ITypeNameFactory

CLSID_CLRDebuggingLegacy

IID_ICorDebug

CLSID_CLRStrongName

IID_ICLRStrongName

Platforms: See .NET Framework System Requirements.

Header: MetaHost.h

Library: Included as a resource in MSCorEE.dll

.NET Framework Versions: 4.6 RC, 4.5.2, 4.5.1, 4.5, 4

Show:
© 2015 Microsoft