Both custom exception handler AND MadExcept dialog shown
Posted: Tue Jul 13, 2004 10:37 am
I'm having yet another problem with my custom exception handler. If an exception occurs during application initialization, both my custom handler and the madexcept dialog are show. If the exception is raised later on, f.e. in a buttonclick, everything works ok.
Here's the example code:
Here's the example code:
Code: Select all
unit Unit1;
interface
implementation
uses
Windows, Dialogs, SysUtils, MadExcept;
procedure MyExceptEventHandler(frozen : boolean;
exceptObject : TObject;
exceptAddr : pointer;
crashedThreadId : dword;
var bugReport : string;
var screenShot : string;
var canContinue : boolean;
var handled : boolean);
begin
ShowMessage(0, 'Test', 'Test', MB_ICONERROR);
handled := True;
end;
initialization
RegisterExceptionHandler(MyExceptEventHandler, True);
raise Exception.Create('');
// after the above call, both my messagebox and both the mad dialog are shown
end.