DELPHI中创建调用DLL

来源:互联网 发布:数据库查找工具 编辑:程序博客网 时间:2024/04/29 02:56

一,新建

new->other->dll wizard

 

二,

 

library new;

 

uses
  SysUtils,
  Classes,
  Dialogs;

 

{$R *.res}

 

procedure dll;
begin
showmessage('delphi');

end;

 

exports
 dll;

begin
end.

 

三,保存,

 

四,project->build project

 

五,引用 :procedure dll; external 'new.dll';

 

{*********************************************

 

unit Unit1;

 

interface

 

uses

  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

  Dialogs, StdCtrls;

 

type

  TForm1 = class(TForm)

    Button1: TButton;

    procedure Button1Click(Sender: TObject);

    procedure FormCreate(Sender: TObject);

  private

    { Private declarations }

  public

    { Public declarations }

  end;

 

var

  Form1: TForm1;

 

implementation

 

{$R *.dfm}

 

procedure dll; external 'new.dll';

 

procedure TForm1.Button1Click(Sender: TObject);

begin

     dll

end;

 

end.

 

**********************************************}

 

 

原创粉丝点击