library Project2; uses Forms, Unit1 in 'Unit1.pas' {Form1}; {$R *.res} var DLLform:TForm1; begin DLLform:=TForm1.Create(Application); DLLform.Show; end.
第一种,无输出函数,用LoadLibraryA载入DLL就会出现窗口
易语言代码如下
另一种,建议一个输出函数,这个函数是建立一个窗口
library Project2; uses Unit1 in 'Unit1.pas' {Form1}; exports Creatwindows; end. unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs; type TForm1 = class(TForm) private public end; var Form1: TForm1; function Creatwindows:LongWord;stdcall; implementation {$R *.dfm} function Creatwindows:LongWord; var DLLform:TForm1; begin DLLform:=TForm1.Create(Application); DLLform.Show; Result:=1; end; end.
易语言代码如下
心得:编译DLL的时候最好关360,很简单一个DLL,半天无法编译出来,结果把360关闭后,就编译出来了,看来360牛B