DLL点关闭的时候,主程序就自动置后了,不知为什么。代码如下,
这个是普通窗体调用DLL。
procedure TForm1.Button1Click(Sender: TObject);type
  TGetForm = function (H: THandle) : Integer; cdecl;
var
  DllForm : TGetForm;
  DllHandle : THandle;
  nn : integer;
begin
  DllHandle := LoadLibrary(PChar('DebtMoney.dll'));  try
    if DllHandle <> 0 then
    begin
      DllForm := GetProcAddress(DllHandle, 'EDebtMoney');
      nn := DllForm(Application.Handle) ;
      form1.Caption  := inttostr(nn);
    end;
  finally
    FreeLibrary(DllHandle);
  end;
end;这个是无边框窗体的DLL://DLL入口
Function EDebtMoney(H: THandle):integer;
begin
Application.Handle := H;
with TForm1.Create(Application) do tryKeyPreview :=True;
ShowModal;
Result := MySelect ;
finally
Free; { 调用结束时销毁窗口 }
end;
end;请时间的老师帮忙看下 谢谢