I
ivw
Unregistered / Unconfirmed
GUEST, unregistred user!
//是这样写dll吗?
library mydll;
{ -- }
uses
SysUtils,
Classes;
{$R *.res}
function aa():string;
begin
aa:='aaaaaaaaaaaa';
end;
function bb(aa:string;var cc:string):string;
begin
if aa='a' then
cc:='aaaaaaaaaaaaaaaaaa'
else
cc:='bbbbbbbbbbbbbb';
end;
end.
//////////////////////////////////////////////////////
//是这样调用吗?
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
function bb(aa:string;var cc:string):string;
Stdcall; external 'mydll.dll';
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var straa:string;
begin
bb('b',straa);
showmessage(straa);
end;
end.
library mydll;
{ -- }
uses
SysUtils,
Classes;
{$R *.res}
function aa():string;
begin
aa:='aaaaaaaaaaaa';
end;
function bb(aa:string;var cc:string):string;
begin
if aa='a' then
cc:='aaaaaaaaaaaaaaaaaa'
else
cc:='bbbbbbbbbbbbbb';
end;
end.
//////////////////////////////////////////////////////
//是这样调用吗?
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
function bb(aa:string;var cc:string):string;
Stdcall; external 'mydll.dll';
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var straa:string;
begin
bb('b',straa);
showmessage(straa);
end;
end.