Unmanaged DLL Export with Robert Giesecke Library Not Working Under Windows XP

偶尔善良 提交于 2020-01-05 07:59:30

问题


I have a pure C# dll that I compiled using Unmanaged DLL Export / Robert Giesecke which compiles successfully and can be called from a C++ application when running on Windows 7. The DLL is compiled for Win32 (x86). Then the same program and DLL are run on a windows XP machine the executable program cannot call the exported DLL function.

here is an example of the exported function:

   [DllExport("SetTerminalHandle", CallingConvention = CallingConvention.Cdecl)]

       public static void SetTerminalHandle(int hTerminal, string strTerminalPath, string strAccountServer)
       {
           terminalHandle = hTerminal;
           terminalPath = strTerminalPath;
           accountServer = strAccountServer;
       }

Any ideas. I know that to create a working Windows XP dll or exe under Win 7 w/ VS 2012 for C++ you need to set the compiler tool to Platform Set to: Visual Studio 2012 - Windows XP (v110_xp) You cannot seem to do this with the C# compiler.

Any Ideas ?

Thanks


回答1:


For X# you do not need this kind of stuff, the most important thing is the .net framework you are compiling against..

Most likely you compiled your C# code against a .net version which is not compatible with Windows XP.

.NET 3.5 will give you compatibility with XP SP2. If you want compatibility with any level of XP, you need to go all the way back to .NET 2.0.



来源:https://stackoverflow.com/questions/20849836/unmanaged-dll-export-with-robert-giesecke-library-not-working-under-windows-xp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!