Disable/Enable madExcept runtime!

delphi package - automated exception handling
Post Reply
coolman_kk
Posts: 7
Joined: Thu Apr 28, 2005 11:55 am

Disable/Enable madExcept runtime!

Post by coolman_kk »

Hello,
Can I disable/enable madExcept runtime?

Thanks. :idea:
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

For what purpose would you need that?

You can't fully disable it, but you can let it behave more or less similar to how Delphi would behave without madExcept.
coolman_kk
Posts: 7
Joined: Thu Apr 28, 2005 11:55 am

Post by coolman_kk »

Hello madshi,

I turn on madExcept in my project, but before run some code I want disable it temporary and then enable it again.
Can I do that?

I have problem with FastReport for Delphi and want when get error message to get it from FastReport not from madExcept.

Thanks.
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

Can you show me some of that FastReport code for which you want to disable madExcept?

You could do this:

Code: Select all

try
  SomeFastReportCode;
except
  // do your own stuff here
  // madExcept will not show up, if you handle exceptions yourself
  // in a try..except block
end;
coolman_kk
Posts: 7
Joined: Thu Apr 28, 2005 11:55 am

Post by coolman_kk »

begin
//Here disable madExcept
Form113.frxReport1.ShowReport( True );
//After exit form FastReport, enable madExcept again
end;
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

Does this do what you need?

Code: Select all

try
  Form113.frxReport1.ShowReport( True );
except
  on E: Exception do
    MessageBox(0, pchar(E.Message), 'Error', MB_ICONERROR);
end;
coolman_kk
Posts: 7
Joined: Thu Apr 28, 2005 11:55 am

Post by coolman_kk »

Thank you.
Post Reply