本文整理自网络,侵删。
创建并调用 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;
相关阅读 >>
Delphi 新增功能之: ioutils 单元(7): tfile 结构的功能
Delphi winapi: isiconic、iszoomed - 分别判断窗口是否已最小化、最大化
Delphi xe5 for android 调用java类库必看的文件
更多相关阅读请进入《Delphi》频道 >>