你的showform函数写的不对,应该把主窗体的handle传到dll中<br>Showform(Ahandle:Thandle):longint;Stdcall<br>begin<br> Application.Handle:=Ahandle;<br> if Not Assigned(DllForm) then<br> DllForm:=TDllForm.Create(Application);<br> DllForm.Show;<br>end;<br>出口函数这样写就可以了.<br>