1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
unit UE00_Exception;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls;
type
ExceptionPgi = class(Exception)
private
LastExceptAddr : Pointer; // Address of last exception
Calls : String; // Stack of called routines
public
procedure OnAppliException (Sender: TObject; E: Exception);
end;
implementation
procedure ExceptionPgi.OnAppliException(Sender:TObject; E:Exception);
var
ErrorText : String;
begin
try
ErrorText:= 'Une erreur a été declenché!' + #13#10 + #13#10
+ ExtractFileName(Application.ExeName)+' '+DateTimeToStr(Now)+#13#10
+ 'Exception ' + E.ClassName + ' à l''adresse $'
+ IntToHex(Integer(ExceptAddr), 8) + #13#10 + #13#10
+ 'Arbre d''appels des routines:' + #13#10 + Calls;
MessageDlg(ErrorText, mtError, [mbOK], 0);
LastExceptAddr := Nil;
Calls := '';
Except
MessageDlg('Erreur dans le gestionnaire d''exceptions.', mtError, [mbOk], 0);
end;
end;
end. |
Partager