现成例子我有一个<br><br>library Project1;<br><br>uses<br> SysUtils,<br> Forms,<br> Classes,<br> Unit1 in 'Unit1.pas' {Form1};<br><br>{$R *.res}<br>procedure Showme(AHandle:THandle);stdcall;<br>begin<br> Application.Handle:=AHandle;//此处的参数是你调用此DLL的Application的handle为的是保持线程的同步<br> Form1:=TForm1.Create(Application);<br> Try<br> Form1.ShowModal;<br> finally<br> Form1.free;<br> Form1:=nil;<br> end;<br>end;<br>exports<br> showme;<br>begin<br>end.<br><br><br>调用此DLL的程序的部分代码<br><br>procedure showme(AHandle:THandle);stdcall;external 'Project1.dll';<br><br><br>procedure TForm1.Button1Click(Sender: TObject);<br>begin<br> showme(Application.Handle);<br>end;<br><br><br>{注意调用函数名的大小写}<br><br>