DELPHI技术

博客园 首页 新随笔 联系 订阅 管理

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.

posted on 2005-07-16 11:49  DELPHI技术  阅读(595)  评论(0编辑  收藏  举报