N
netbug
Unregistered / Unconfirmed
GUEST, unregistred user!
我想建立个自己的DLL,故我首先编写了DLL代码,然后把它编译并建立了模块DLLExample.dll。
接着我按书上说的,在Delphi中编写了如下的输入单元:
unit TestDll;
interface
uses
Graphics;
procedure Circle(ACanvas:TCanvas;x,y,r:integer);
procedure LineBtw(ACanvas:TCanvas;x1,y1,x2,y2:integer);
implementation
const
LibName='DLLExample';
procedure circle;external LibName;
procedure LineBtw;external LibName;
{$R *.DFM}
end.
但在编译时,系统提示需要TForm1窗体文件,我就写了如下代码:
unit TESTDLL;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
procedure Circle(ACanvas:TCanvas;x,y,r:integer);
procedure LineBtw(ACanvas:TCanvas;x1,y1,x2,y2:integer);
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
const
LibName='DLLExample';
procedure circle;external LibName;
procedure LineBtw;external LibName;
{$R *.DFM}
procedure TForm1.FormCreate(Sender: TObject);
begin
end;
end.
编译能通过,但打开另一个application时,系统提示参数错误。
我想问:
如何建立输入单元文件?它的步骤是怎样的?
谢谢。
接着我按书上说的,在Delphi中编写了如下的输入单元:
unit TestDll;
interface
uses
Graphics;
procedure Circle(ACanvas:TCanvas;x,y,r:integer);
procedure LineBtw(ACanvas:TCanvas;x1,y1,x2,y2:integer);
implementation
const
LibName='DLLExample';
procedure circle;external LibName;
procedure LineBtw;external LibName;
{$R *.DFM}
end.
但在编译时,系统提示需要TForm1窗体文件,我就写了如下代码:
unit TESTDLL;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
procedure Circle(ACanvas:TCanvas;x,y,r:integer);
procedure LineBtw(ACanvas:TCanvas;x1,y1,x2,y2:integer);
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
const
LibName='DLLExample';
procedure circle;external LibName;
procedure LineBtw;external LibName;
{$R *.DFM}
procedure TForm1.FormCreate(Sender: TObject);
begin
end;
end.
编译能通过,但打开另一个application时,系统提示参数错误。
我想问:
如何建立输入单元文件?它的步骤是怎样的?
谢谢。