private
{ Private declarations }
public
procedure GlobalExceptionHandler(Sender: TObject; E: Exception);
{ Public declarations }
end;proced
ure TForm1.FormCreate(Sender: TObject);
begin
Application.OnException := GlobalExceptionHandler;
end;
procedure TForm1.GlobalExceptionHandler(Sender: TObject; E: Exception);
begin
mmLog.Lines.Add(Sender.ClassName + ': ' + E.Message);
end;