使用Robert Giesecke库的非托管DLL导出在Windows XP下不起作用 [英] Unmanaged DLL Export with Robert Giesecke Library Not Working Under Windows XP
问题描述
这里是导出函数的一个例子:
[DllExport(SetTerminalHandle,CallingConvention = CallingConvention.Cdecl)]
public static void SetTerminalHandle(int hTerminal ,string strTerminalPath,string strAccountServer)
{
terminalHandle = hTerminal;
terminalPath = strTerminalPath;
accountServer = strAccountServer;
}
任何想法。我知道要创建一个工作的Windows XP dll或exe在Win 7 w / VS 2012 for C ++中,您需要将编译器工具设置为平台设置为:Visual Studio 2012 - Windows XP(v110_xp)
您似乎不能使用C#编译器执行此操作。
任何想法?
谢谢
对于X#,你不需要这样的东西,最重要的是你正在编译的.net框架..
最有可能的是,您编译的C#代码是与Windows XP不兼容的.net版本。
.NET 3.5将为您提供兼容性XP SP2。如果您希望与任何级别的XP兼容,则需要一直返回到.NET 2.0。
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
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.
这篇关于使用Robert Giesecke库的非托管DLL导出在Windows XP下不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!