c# - Unmanaged DLL doesn't work in Windows 7 -


last week stumbled upon problem , i'm not sure how solve it. spent whole day try solve alone.

i have unmanaged dll worked fine in c# code on windows xp (32 bit) system. when try run c# code on newer system (for example windows 7 (64 bit) doesn't work anymore.

this code

[dllimport("mytest.dll")] [return: marshalas(unmanagedtype.lpstr)] public static extern string dosomething(); 

as said works fine on windows xp system doesn't work on windows 7 system. when try run code on windows 7 system following exception (translated english)

the dll "mytest.dll": recurrence deep, stackoverflow. (exception hresult: 0x800703e9) can not loaded.

i'm guessing problem because of this:

load 32bit dll library in 64bit application

how call win32 dll in windows 7

i'm not sure because when search exception in combination dllimport can't find anything.

if problem best solution?

you check:

  1. unmanaged dll dependencies dependency walker. there might missing c++ redistributable. msvcr{xxx}.dll {xxx} specifies version of redistributable.
  2. compilation settings of managed application in end loads unmanaged dll (any cpu, x86 or x64). might managed application set cpu unmanaged application x86 , therefore load of unmanaged dll fails.
  3. installed .net frameworks on windows xp , windows 7. problem might different patches applied on .net frameworks least problem.

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -