这个要调用到WINDOWS下的API函数,具体的你可以查一下WIN下的API函数,有说的,一般DELPHI书上也有对错误处理的说明!

解决方案 »

  1.   

    try
     ....
     ....
     ....
    except
      ....
     写错误日志....
      ....
      exit;
    end;
      

  2.   

    楼上的方法要写很多的try才行
    delphi在调试的时候可以自动产生异常信息,我就想在那个自动的异常之前做一些事.
      

  3.   

    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs;type
      TForm1 = class(TForm)
        ApplicationEvents1: TApplicationEvents;
        procedure ApplicationEvents1Exception(Sender: TObject; E: Exception);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.dfm}procedure TForm1.ApplicationEvents1Exception(Sender: TObject;
      E: Exception);
    begin
      ....
     写错误日志....//只有一个。
      ....
    end;end.