General exceptions for Delphi

There is such advice in .NET WinForms that I can catch any exception thrown at the application level.

Is it possible to do this in Delphi as well, if the source of the exception cannot be associated with the try / except block.

+5
source share
1 answer

You can attach an event handler to Application.OnExceptionand handle any unhandled exception.

Depending on the version of Delphi you may

  • attach and implement the entire event handler in the code in your main form, dpr or wherever you are in the form Application.OnException := DoApplicationException.
  • remove the component TApplicationEventsin your main form, double-click the OnException event and implement your code.
+13
source

All Articles