Delphi开发DLL的方法

1、1)FILE—>NEW—>OTHER,选择DLL。

     2)FILE-->NEW-->UNIT。然后写代码。在interface 后面加入

         function countnum(i:integer):integer;export;

         在implementation后面写函数的代码。

     3)在DLL的project文件里面的{$R *.res}后面加上exports countnum;

调试成功以后 会生成一个 project1.dll 文件

2、调用DLL的方法:在unit 部分编写代码时implementation 前面写入一句function countnum(i:integer):integer;far;external 'Project1.dll';

posted @ 2014-08-11 17:30  洗刷貔犰  阅读(229)  评论(1编辑  收藏  举报