Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Managed C++/CLI
  4. FileLoadException

FileLoadException

Scheduled Pinned Locked Moved Managed C++/CLI
c++csharpdotnettestingbeta-testing
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mOOse pl
    wrote on last edited by
    #1

    Hi, I got some unexpected trouble when I tried to write a managed wrapper around a native dll. This is what I did: 1) wrote a wrapper in C++/CLI and compiled it into dll file (with /clr switch) 2) created project in C# and added reference to a wrapper 3) in C# I created instances of some classes from my wrapper, everything compiled fine 4) when I ran C# project I got FileLoadException saying: A procedure imported by [assembly name] could not be loaded. Any ideas what might cause FileLoadException? This is a simplified C++/CLI code which I used for testing and got the same problem as described above: // test.h #pragma once #include #pragma comment(lib, "Irrlicht.lib") using namespace System; using namespace irr; // from irrlicht.h namespace test { public ref class Class1 { public: void Foo(void) { System::Console::WriteLine("blah blah blah"); } void Bar() { **IrrlichtDevice * dev = createDevice(); // calling native function** } }; } -- moose

    U 1 Reply Last reply
    0
    • M mOOse pl

      Hi, I got some unexpected trouble when I tried to write a managed wrapper around a native dll. This is what I did: 1) wrote a wrapper in C++/CLI and compiled it into dll file (with /clr switch) 2) created project in C# and added reference to a wrapper 3) in C# I created instances of some classes from my wrapper, everything compiled fine 4) when I ran C# project I got FileLoadException saying: A procedure imported by [assembly name] could not be loaded. Any ideas what might cause FileLoadException? This is a simplified C++/CLI code which I used for testing and got the same problem as described above: // test.h #pragma once #include #pragma comment(lib, "Irrlicht.lib") using namespace System; using namespace irr; // from irrlicht.h namespace test { public ref class Class1 { public: void Foo(void) { System::Console::WriteLine("blah blah blah"); } void Bar() { **IrrlichtDevice * dev = createDevice(); // calling native function** } }; } -- moose

      U Offline
      U Offline
      ursus zeta
      wrote on last edited by
      #2

      Show us the code for the wrapper. That's probably where your problem is.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups