title: EEFileLoadException when using C# classes in C++(win32 app)
body: <p>For deployment reasons, I am trying to use IJW to wrap a C# assembly in C++ instead of using a COM Callable Wrapper.  </p>
  
  <p>I've done it on other projects, but on this one, I am getting an EEFileLoadException.  Any help would be appreciated!</p>
  
  <p>Managed C++ wrapper code (this is in a DLL):</p>
  
  <pre><code>extern "C" __declspec(dllexport) IMyObject* CreateMyObject(void)
  {
      //this class references c# in the constructor
      return new CMyWrapper( );
  }
  
  extern "C" __declspec(dllexport)  void DeleteMyObject(IMyObject* pConfigFile)
  {
      delete pConfigFile;
  }
  
  extern "C" __declspec(dllexport) void TestFunction(void)
  {
      ::MessageBox(NULL, _T("My Message Box"), _T("Test"), MB_OK);
  }
  </code></pre>
  
  <p>Test Code (this is an EXE):</p>
  
  <pre><code>typedef void* (*CreateObjectPtr)();
  typedef void (*TestFunctionPtr)();
  
  int _tmain testwrapper(int argc, TCHAR* argv[], TCHAR* envp[])
  {
      HMODULE hModule = ::LoadLibrary(_T("MyWrapper"));
      _ASSERT(hModule != NULL);
  
      PVOID pFunc1 = ::GetProcAddress(hModule, "TestFunction");
      _ASSERT(pFunc1 != NULL);
      TestFunctionPtr pTest = (TestFunctionPtr)pFunc1;
  
      PVOID pFunc2 = ::GetProcAddress(hModule, "CreateMyObject");
      _ASSERT(pFunc2 != NULL);
      CreateObjectPtr pCreateObjectFunc = (CreateObjectPtr)pFunc2;
  
      (*pTest)();  //this successfully pops up a message box
      (*pCreateObjectFunc)();  //this tosses an EEFileLoadException
  
      return 0;
  }
  </code></pre>
  
  <p>For what it's worth, the Event Log reports the following:
  .NET Runtime version 2.0.50727.143 - 
  Fatal Execution Engine Error (79F97075) (80131506)</p>
  
  <p>Unfortunately, Microsoft has no information on that error.</p>