本文整理自网络,侵删。
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;
相关阅读 >>
Delphi中组件panel、splitter、groupbox、按钮组件(checkbox...)、计时器、滚动条、多选卡
Delphi webbrowser载入自定义html内容并显示
更多相关阅读请进入《Delphi》频道 >>