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中组件panel、splitter、groupbox、按钮组件(checkbox...)、计时器、滚动条、多选卡

Delphi c语言对比指针的用法

system单元一些有用的变量或者常数

Delphi unigui 控件动画

Delphi android 拨打电话

Delphi webbrowser载入自定义html内容并显示

Delphi firedac操作sqlite内存数据库

Delphi一个抓屏的函数

Delphi ticon保存ico文件时失真的解决办法

Delphi twebbrowser静音

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



打赏

取消

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

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

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

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

评论

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