[ DllImport("HotelLock.dll",CallingConvention=CallingConvention.StdCall)] public static extern short EncodeInit(IntPtr pointer)
delphi的这种定方法怎样转为C# Parameter : array[0..255] of char;
procedure TAPI_Demo.EncodeInit_BtClick(Sender: TObject); var Parameter : array[0..255] of char; FunRet : smallint; begin LStrcpy(Parameter,Pchar(LockPath_Ed.Text)); FunRet := EncodeInit(@Parameter); if FunRet <> 1 then begin MakeCardMsgBox(FunRet); exit; end;这个怎么转为C# LStrcpy(Parameter,Pchar(LockPath_Ed.Text));
在.net里定义时该用什么类型.
[ DllImport("HotelLock.dll",CallingConvention=CallingConvention.StdCall)]
public static extern short EncodeInit(IntPtr pointer)
Parameter : array[0..255] of char;
var
Parameter : array[0..255] of char;
FunRet : smallint;
begin
LStrcpy(Parameter,Pchar(LockPath_Ed.Text));
FunRet := EncodeInit(@Parameter);
if FunRet <> 1 then
begin
MakeCardMsgBox(FunRet);
exit;
end;这个怎么转为C#
LStrcpy(Parameter,Pchar(LockPath_Ed.Text));
看看这个是否有帮助