L
lsha
Unregistered / Unconfirmed
GUEST, unregistred user!
extern "C" __declspec(dllexport) void __stdcall P2T(UCHAR *s, UCHAR *d);
extern "C" __declspec(dllexport) void __stdcall T2P(UCHAR *s, UCHAR *d);
指针所指的空间在delphi中已经申请,在dll中不会再申请;
我用如下方法调用,却不行,请大虾们救命啊!!!
procedure P2T(var s, d: array of byte);
stdcall;
procedure T2P(var s, d: array of byte);
stdcall;
procedure call_dll;
var
s: array [0..400] of byte;
d: array [0..400] of byte;
t: array [0..400] of byte;
str: String;
i: Integer;
s1, d1, t1: byte;
begin
str := edit1.text;
FillChar(s, SizeOf(s), 0);
FillChar(d, SizeOf(d), 0);
FillChar(t, SizeOf(d), 0);
for i := 1 to Length(str)do
s[i - 1] := Ord(str);
T2P(s, d);
P2T(d, t);
edit1.Text := String(@d);
edit2.Text := String(@t);
end;
extern "C" __declspec(dllexport) void __stdcall T2P(UCHAR *s, UCHAR *d);
指针所指的空间在delphi中已经申请,在dll中不会再申请;
我用如下方法调用,却不行,请大虾们救命啊!!!
procedure P2T(var s, d: array of byte);
stdcall;
procedure T2P(var s, d: array of byte);
stdcall;
procedure call_dll;
var
s: array [0..400] of byte;
d: array [0..400] of byte;
t: array [0..400] of byte;
str: String;
i: Integer;
s1, d1, t1: byte;
begin
str := edit1.text;
FillChar(s, SizeOf(s), 0);
FillChar(d, SizeOf(d), 0);
FillChar(t, SizeOf(d), 0);
for i := 1 to Length(str)do
s[i - 1] := Ord(str);
T2P(s, d);
P2T(d, t);
edit1.Text := String(@d);
edit2.Text := String(@t);
end;