我写下主要代码;delphi dll代码:
type
Tstudent =record
name : pchar;
age : integer;
end;function to_student(ctemp : pchar) : Tstudent;stdcall;
var student : Tstudent;
begin
if ctemp='aa' then
begin
student.name:=pchar('aa');
student.age=20;
result:=student;
end;
end;
exports to_student;vb调用代码:
private type Tstudent
name as string
age as integer
end typeprivate declare function lib "aa.dll" (byval ctemp as string) as Tstudent
但就是返回不了结构结数据。大家出出注意吧。
type
Tstudent =record
name : pchar;
age : integer;
end;function to_student(ctemp : pchar) : Tstudent;stdcall;
var student : Tstudent;
begin
if ctemp='aa' then
begin
student.name:=pchar('aa');
student.age=20;
result:=student;
end;
end;
exports to_student;vb调用代码:
private type Tstudent
name as string
age as integer
end typeprivate declare function lib "aa.dll" (byval ctemp as string) as Tstudent
但就是返回不了结构结数据。大家出出注意吧。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货