动态连接库调用
wx114 2006-12-07 03:44:39 Delphi里动态连接库调用声明:(Delphi是正确)
function Coding(input:string):pchar;
stdcall;far;external 'convertdll.dll'name 'Coding';
function Decode(input:string):pchar;
stdcall;far;external 'convertdll.dll'name 'Decode';;
我翻译成C#
[DllImport("convertdll.dll", EntryPoint = "Coding", CallingConvention = CallingConvention.StdCall)]
public static extern string Coding(string input);
[DllImport("convertdll.dll", EntryPoint = "Decode", CallingConvention = CallingConvention.StdCall)]
public static extern String Decode(String input);
传入同样的值 ,Delphi中 Decode()得到正确的值,C#得到0000为什么?大伙帮忙看看,谢谢