Before madExcept window appears i want to write a log file

delphi package - automated exception handling
Post Reply
ai148
Posts: 16
Joined: Fri Oct 04, 2013 12:50 pm

Before madExcept window appears i want to write a log file

Post by ai148 »

When an exception occurs i want to save internal log data which i have collected.
When the madExcept window is shown, it's already too late, because in many cases the program cannot continue.
Is there an event like OnBeforeMadExceptWindowShow or do i have to use a Callback?

Can someone provide a Delphi code snippet to do this?

Thank you.
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: Before madExcept window appears i want to write a log fi

Post by madshi »

You can use madExcept.RegisterExceptionHandler to register a callback which is called for every exception. If you use the "epQuickFiltering" parameter, your handler should be called before the exception box is shown. A little sample code (though not with the exact parameters you need) is shown at the bottom of this page:

http://help.madshi.net/HowToUseMadExcept.htm
ai148
Posts: 16
Joined: Fri Oct 04, 2013 12:50 pm

Re: Before madExcept window appears i want to write a log fi

Post by ai148 »

Thank you! Very fast and useful answer!!
Post Reply