创建并调用 DLL(1)

//通过 DLL Wizard 建立:
library TestDLL;

uses
  SysUtils,
  Classes,
  Dialogs;

{$R *.res}

//建立过程
procedure Test;
begin
  ShowMessage('TestDLL.Test');
end;

//输出
exports
  Test;

begin
end.


//在其他工程调用,如果不在一个工程组,需要在相同目录下、System32下或指定路径;
//声明可以在实现区或接口区,这里的函数名要一致,甚至大小写。

//调用测试:
procedure Test; external 'TestDLL.dll';

procedure TForm1.Button1Click(Sender: TObject);
begin
  Test;
end;
原文地址:https://www.cnblogs.com/wanqian/p/3109130.html