- 人气:
- 放大
- 缩小
- 二维码
- 赞赏
delphi package 把函数单元做成bpl调用
unit MYfunction;
interface
function fun(i: Integer):Integer;stdcall;
implementation
function fun(i: Integer):Integer;stdcall;
begin
Result := i+1;
end;
exports fun;
end.
之后New->Other->Package->Add MYfunction.pas->save MyPackage.dpk->Compile->生成MyPackage.bpl
EXE调用:
function fun(i: Integer):Integer;stdcall;external 'MyPackage.BPL';
procedure TForm1.Button1Click(Sender: TObject);
begin
ShowMessage(IntToStr(fun(1)));
end;