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;

相关阅读 >>

Delphi查找特定的exe是否在运行

Delphi 实现窗体倒计时进度条显示

Delphi 如何快速读取文本文件

Delphi 运行clsid文件

Delphi实现使用tidhttp控件向https地址post请求

Delphi 除法 "/" 与 div 的不同

Delphi android实例-读取设备联系人(xe8+小米2)

Delphi 循环 low high 用法

Delphi html document接口获取网页中所有图片

Delphi tidhttp 超时设置无效的解决方法

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...