unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
btn1: TButton;
procedure btn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
//DLL的静态调用
Function MyMax ( X , Y : integer ) : integer ; stdcall ; external 'Project1.dll' ; //第一步:声明函数
procedure TForm1.btn1Click(Sender: TObject);
begin
ShowMessage ( IntToStr(MyMax(30,50)) ) ; //第二步:调用声明函数
end;
end.