××××dll中的函数function test():string;stdcall;
begin
result:='成功返回字符串';
end;××××在VB中调用Private Declare Function test Lib "Project1.dll" () As StringPrivate Sub Command1_Click()
MsgBox test
End Sub这样会非法操作~~~该怎么办呢???
begin
result:='成功返回字符串';
end;××××在VB中调用Private Declare Function test Lib "Project1.dll" () As StringPrivate Sub Command1_Click()
MsgBox test
End Sub这样会非法操作~~~该怎么办呢???
begin
result:='成功返回字符串';
end;××××在VB中调用Private Declare Sub test Lib "Project1.dll" (s As String)Private Sub Command1_Click()
Dim s As String*256 s = ""
test(s)
MsgBox s
End Sub
SysUtils, Classes, Windows;...procedure test(s:pchar);stdcall;
var
A: string;
begin
A:='成功返回字符串';
CopyMemory(s, @A[1], Length(A));
end;××××在VB中调用Private Declare Sub test Lib "Project1.dll" (ByVal s As String)Private Sub Command1_Click()
Dim s As String * 256 s = ""
test(s)
MsgBox s
End Sub