本文整理自网络,侵删。
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实现使用tidhttp控件向https地址post请求
Delphi android实例-读取设备联系人(xe8+小米2)
Delphi html document接口获取网页中所有图片
更多相关阅读请进入《Delphi》频道 >>