Application.Destroy;
一般情况应该写为
Application.Terminate;

解决方案 »

  1.   

    就是改为Application.Terminate;同样还是有错误........
      

  2.   

    Application.Initialize;
      Application.CreateForm(TfMDIMain, fMDIMain);
      Application.CreateForm(TdmClient, dmClient);
      fLogin := TFLogin.Create(Application);
      if fLogin.ShowModal = mrOK then
      begin
        fLogin.Free;
        Application.Run;
      end
      else
      begin
        fLogin.Free;
        Application.Terminate
      end;
      

  3.   

    Dephi帮助
    Destroys the application instance and all of its associated memory.destructor Destroy; override;DescriptionNever call Application.Destroy or Application.Free. Instead, use the application抯 Terminate method to end the application.Destroy signals that the application has been deactivated before calling the inherited destructor. It then frees memory for hooked windows, the application instance, other object instances and lists that were created at application startup or that accumulated during executionSince the Application owns all forms (usually), it destroys these forms in its destructor.
      

  4.   

    Application.CreateForm(TfMDIMain, fMDIMain);
    Application.CreateForm(TdmClient, dmClient);
    这两句的顺序很重要,一般情况下,应该换一下
      

  5.   

    TdmClient应该是数据模块或者是远程数据!
    但你说的错误不应该处在这里!
    我的测试代码如下,不会错呀!
    你可以新建一个应用测一下,也许你的其他地方,
    program Project1;uses
      Forms,
      Controls,
      Unit1 in 'Unit1.pas' {Form1},
      Unit2 in 'Unit2.pas' {FLogin};{$R *.res}begin
      Application.Initialize;
      Application.CreateForm(TForm1, Form1);
      Application.CreateForm(TFLogin, FLogin);
      fLogin := TFLogin.Create(Application);
      if fLogin.ShowModal = mrOK then
      begin
        Application.Run;
      end
      else
      begin
        Application.Terminate;
      end;
    end.
      

  6.   

    我告诉你是这样的,原因是当,你的返回不是mrok时,你
    的application.Destroy;时你的application还没有run过怎么可以呢  Application.Initialize;
      if fLogin.ShowModal = mrOK then
      begin
      Application.CreateForm(TfMDIMain, fMDIMain);
      Application.CreateForm(TdmClient, dmClient);
      fLogin := TFLogin.Create(Application);
      Application.Run;
      end
      else
      begin
        Application.Run;
        Application.Destroy;
      end;************
    * 努力学习 *
    *   全为   *
    *¥人民币¥*
    ************
      

  7.   

    错了
    我告诉你是这样的,原因是当,你的返回不是mrok时,你
    的application.Destroy;时你的application还没有run过怎么可以呢
    安你的方法可以这样改
      Application.Initialize;
      Application.CreateForm(TfMDIMain, fMDIMain);
      Application.CreateForm(TdmClient, dmClient);
      fLogin := TFLogin.Create(Application);
      if fLogin.ShowModal = mrOK then
      begin
      Application.Run;
      end
      else
      begin
        Application.Run;
        Application.Destroy;
      end;
    不过我更喜欢这样做:
     
      fLogin := TFLogin.Create(Application);
      if fLogin.ShowModal = mrOK then
      begin
      Application.Initialize;
      Application.CreateForm(TfMDIMain, fMDIMain);
      Application.CreateForm(TdmClient, dmClient);  Application.Run;
      end
      else
      begin
        Application.Run;
        Application.Destroy;
      end;************
    * 努力学习 *
    *   全为   *
    *¥人民币¥*
    ************
      

  8.   

    对了,我用的是DcomConnection连接的远程应用程序服务器