Hello,
Here is the code I'm trying to run:
HRESULT hr = S_OK;
ICLRMetaHost *m_pMetaHost = NULL;
ICLRRuntimeInfo *m_pRuntimeInfo = NULL;
ICorRuntimeHost *m_pHost = NULL;
hr = CLRCreateInstance(CLSID_CLRMetaHost, IID_ICLRMetaHost, (LPVOID*) &m_pMetaHost);
if (hr != S_OK)
return hr;
hr = m_pMetaHost->GetRuntime (DOTNETVERSION, IID_ICLRRuntimeInfo, (LPVOID*) &m_pRuntimeInfo);
if (hr != S_OK)
return hr;
hr = m_pRuntimeInfo->GetInterface(CLSID_CLRRuntimeHost, IID_ICLRRuntimeHost, (LPVOID*) &m_pHost );
if (FAILED(hr)) return hr;
hr = m_pHost->Start();
The program crashed upon trying to execute m_pHost->Start().
In the output window, I'm getting first-chance exceptions and an access violation:
First-chance exception at 0x7c812afb in sidebar.exe: 0x04242420: 0x4242420.
'sidebar.exe': Loaded 'C:\WINDOWS\assembly\NativeImages_v4.0.30319_32\mscorlib\246f1a5abb686b9dcdf22d3505b08cea\mscorlib.ni.dll'
'sidebar.exe': Loaded 'C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Culture.dll'
'sidebar.exe': Loaded 'C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\nlssorting.dll'
First-chance exception at 0x79168cef in sidebar.exe: 0xC0000005: Access violation reading location 0xc6c5fb37.
The thread 'Win32 Thread' (0x930) has exited with code -2146233082 (0x80131506).
The thread 'Win32 Thread' (0x67c) has exited with code -2146233082 (0x80131506).
The thread 'Win32 Thread' (0xdfc) has exited with code -2146233082 (0x80131506).
The program '[0x508] sidebar.exe: Native' has exited with code -2146233082 (0x80131506).
Any ideas would be appreciated.
Regards,
Mike