unit FunkFrm;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TFunkForm = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
//Declare the package functions using the StdCall calling convention
procedure FunkForm; stdcall;
function AddEm(Op1, Op2 : Integer) : Integer; stdcall;
//Export the functions
exports
FunkForm,
AddEm;
implementation
{$R *.dfm}
procedure FunkForm;
var
FunkForm : TFunkForm;
begin
FunkForm := TFunkForm.Create(Application);
try
FunkForm.ShowModal;
finally
FunkForm.Free;
end;
end;
function AddEm(Op1, Op2 : Integer) : Integer;
begin
Result := Op1 + Op2;
end;
procedure TFunkForm.Button1Click(Sender: TObject);
begin
ShowMessage('你已经正确地调用了包的导出函数。');
end;
end.