0

I'm loading a MFC dll to my CLI wrapper with

HINSTANCE m_keyManagerLib;
m_keyManagerLib = LoadLibrary("dll");

in destr:

FreeLibrary(m_keyManagerLib);

When I load the dll again I get some access violation errors:

First-chance exception at 0x76fdc518 in TestKeyManagerApp.exe: 0xC0000005: Access violation reading location 0xfffffff8.
First-chance exception at 0x75219673 in TestKeyManagerApp.exe: Microsoft C++ exception: CMemoryException at memory location 0x0030e1cc..
'TestKeyManagerApp.exe': Unloaded 'C:\projects\KeyManagerServer\TestKeyManagerApp\bin\Debug\dll\KeyManagerServerD.dll'

additional infos:

  • load the CLI wrapper into C# program and started there
  • MFC dll
    • Use MFC in a Shared DLL

referenced to: Access violation in MFC dll (wrapped in C++/CLI) started from C# program

Thank you in advance for your help!

greets leon22

Community
  • 1
  • 1
leon22
  • 4,757
  • 18
  • 59
  • 94
  • possible duplicate of [Access violation in MFC dll (wrapped in C++/CLI) started from C# program](http://stackoverflow.com/questions/6693965/access-violation-in-mfc-dll-wrapped-in-c-cli-started-from-c-program) – Hans Passant Jul 18 '11 at 12:45
  • Yes, but this question is about the Loadlibrary problem (I thought I should ask a new question -> sorry) – leon22 Jul 18 '11 at 13:55

0 Answers0