Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 42345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T15:19:24+00:00 2026-05-10T15:19:24+00:00

For deployment reasons, I am trying to use IJW to wrap a C# assembly

  • 0

For deployment reasons, I am trying to use IJW to wrap a C# assembly in C++ instead of using a COM Callable Wrapper.

I’ve done it on other projects, but on this one, I am getting an EEFileLoadException. Any help would be appreciated!

Managed C++ wrapper code (this is in a DLL):

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

Test Code (this is an EXE):

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

For what it’s worth, the Event Log reports the following: .NET Runtime version 2.0.50727.143 – Fatal Execution Engine Error (79F97075) (80131506)

Unfortunately, Microsoft has no information on that error.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T15:19:25+00:00Added an answer on May 10, 2026 at 3:19 pm

    The problem was where the DLLs were located.

    • c:\dlls\managed.dll
    • c:\dlls\wrapper.dll
    • c:\exe\my.exe

    I confirmed this by copying managed.dll into c:\exe and it worked without issue. Apparently, the CLR won’t look for managed DLLs in the path of the unmanaged DLL and will only look for it where the executable is. (or in the GAC).

    For reasons not worth going into, this is the structure I need, which meant that I needed to give the CLR a hand in located the managed dll. See code below:

    AssemblyResolver.h:

    /// <summary> /// Summary for AssemblyResolver /// </summary> public ref class AssemblyResolver { public:  static Assembly^ MyResolveEventHandler( Object^ sender, ResolveEventArgs^ args ) {     Console::WriteLine( 'Resolving...' );      Assembly^ thisAssembly = Assembly::GetExecutingAssembly();     String^ thisPath = thisAssembly->Location;     String^ directory = Path::GetDirectoryName(thisPath);     String^ pathToManagedAssembly = Path::Combine(directory, 'managed.dll');      Assembly^ newAssembly = Assembly::LoadFile(pathToManagedAssembly);     return newAssembly; }  }; 

    Wrapper.cpp:

    #include 'AssemblyResolver.h'  extern 'C' __declspec(dllexport) IMyObject* CreateMyObject(void) {     try     {         AppDomain^ currentDomain = AppDomain::CurrentDomain;         currentDomain->AssemblyResolve += gcnew ResolveEventHandler( AssemblyResolver::MyResolveEventHandler );          return new CMyWrapper( );     }     catch(System::Exception^ e)     {         System::Console::WriteLine(e->Message);          return NULL;     } } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to automate my deployment using phing. I get the below error
I testing the deployment of my project using clickonce. Boy was I in for
I am using ClickOnce deployment for a Windows Forms application and I need configuration
For security reasons, I would like to disable the remote deployment of web applications
I'm trying to simply the deployment of our application and more easily manage the
I'm trying to build a project deployment tool, and part of it needs to
For deployment reasons, my development team is currently stuck with .NET 4. However I
I'm asking because PowerShell confuses me. I've been trying to write some deployment scripts
I am trying to call a WCF service from a Silverlight client using channel
I'm using the maven-assembly-plugin to produce a zip file for some database scripts. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.