风
风铃夜思雨
Unregistered / Unconfirmed
GUEST, unregistred user!
新建EXE工程,在EXE导出一个函数
program mm;
uses
Forms,windows,
m in 'm.pas' {Form1};
function test(i:Integer;b:BOOL;var pChar)Char;stdcall;
begin
if i=1 then
result:='dddddddddddddddddd';
if b then
p:='cccccccccccccccccccccc';
end;
exports
test;
begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.
再建一EXE工程调用
function test(i:integer;b:BOOL;var pChar)Char;stdcall; external 'project1.exe';
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var pchar;
begin
caption:=test(1,False,p);
end;
无法调用。。。报异常。。。有人试过成功吗?
program mm;
uses
Forms,windows,
m in 'm.pas' {Form1};
function test(i:Integer;b:BOOL;var pChar)Char;stdcall;
begin
if i=1 then
result:='dddddddddddddddddd';
if b then
p:='cccccccccccccccccccccc';
end;
exports
test;
begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.
再建一EXE工程调用
function test(i:integer;b:BOOL;var pChar)Char;stdcall; external 'project1.exe';
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var pchar;
begin
caption:=test(1,False,p);
end;
无法调用。。。报异常。。。有人试过成功吗?