.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Post New Web Links

ICorRuntimeHost vs. ICLRRuntimeHost

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :WPF
 

Hello,

since  CorBindToRuntimeEx is deprecated in .Net 4.0 I changed my old C++ (shim) code

ICorRuntimeHost  *m_pHost;

HRESULT hr = S_OK;

hr = CorBindToRuntimeEx(0, 0, 0, CLSID_CorRuntimeHost, IID_ICorRuntimeHost, (PVOID*) &m_pHost);

according to

http://msdn.microsoft.com/en-us/library/01918c6x%28VS.100%29.aspx

to

ICLRRuntimeHost  *m_pHost;

LPCWSTR szclrversion = L"v4.0.30319";
HRESULT hr = S_OK;

ICLRMetaHost    *m_pMetaHost;

hr = CLRCreateInstance(CLSID_CLRMetaHost, IID_ICLRMetaHost, (LPVOID*) &m_pMetaHost);

if (hr != S_OK) {
	return hr;
}

ICLRRuntimeInfo *m_pRuntimeInfo;

hr = m_pMetaHost->GetRuntime (szclrversion, IID_ICLRRuntimeInfo, (LPVOID*) &m_pRuntimeInfo);
if (hr != S_OK) {
	return hr;
}

hr = m_pRuntimeInfo->GetInterface(CLSID_CLRRuntimeHost, IID_ICLRRuntimeHost, (LPVOID*) &m_pHost );

But now I get the compiler errors

'CreateDomainSetup' : is not a member of 'ICLRRuntimeHost'
CreateDomainEx' : is not a member of 'ICLRRuntimeHost'


View Complete Post


More Related Resource Links

How to obtain ICorRuntimeHost* for the current runtime?

  
I am not hosting my own runtime and would like to get an ICorRuntimeHost* for the runtime I'm within.  The environment is one where both a 2.0 and 4.0 runtime can be run side by side.  Any thoughts?  Is this even possible?

Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend