madExcept and DisableTaskWindows()

delphi package - automated exception handling
Post Reply
dcumpian
Posts: 8
Joined: Mon Nov 28, 2005 6:58 pm

madExcept and DisableTaskWindows()

Post by dcumpian »

Hello,

We are evaluating madExcept and have run into an issue. The application we are using as a test bed creates a form with a progress bar during long operations. This progress form is called as follows:

Code: Select all

  FrmProgress:=TFrmProgress.Create(nil);
  FrmProgress.lblHeader.Caption:=Header;
  if Length(Caption) > 50 then
  begin
    Caption:='...'+RightStr(Caption,47);
  end;
  FrmProgress.edtCaption.Text:=Caption;
  FrmProgress.edtCaption.DoubleBuffered:=TRUE;
  if AllowCancel then
  begin
    FrmProgress.btnCancel.Enabled:=TRUE;
  end;
  if fsShowing in FrmMain.FormState then
  begin
    FrmProgress.Position:=poDeskTopCenter;
  end;
  FrmMain.WindowList:=DisableTaskWindows(FrmProgress.Handle);
  FrmProgress.Show;
  Application.ProcessMessages;
The DisableTaskWindows() causes the progress form to act like a MODAL window, without actually stopping the application beneath the window. The problem is that this seems to block madExcept's exception window from appearing if an error occurs while this progress window is open. Is our assumption correct? If so, is there a workaround?

Thanks,
Dan
madshi
Site Admin
Posts: 10766
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

I don't see why that should stop madExcept's window from appearing. Can you reproduce this problem in a test project, too, or only in your big main project? If you can reproduce it in a test project, could you please send that to me?
dcumpian
Posts: 8
Joined: Mon Nov 28, 2005 6:58 pm

Post by dcumpian »

You beat me...I was on my way back here to amend my issue. It turns out that this isn't the problem after all, so you're right.

The problem is that MySQLDac uses a convoluted exception handling process and it looks like the exception is actually getting lost before it can be caught by madExcept. With madExcept disabled, the same result is true as well. The only way to see the exception is in the IDE.

Thanks for your quick response, but this isn't your issue after all...off I go to MicroOlap's site...

Regards,
Dan
madshi
Site Admin
Posts: 10766
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

If you want to make the exception visible, you can use RegisterHiddenExceptionHandler and inside your callback you can set "handled := false". As a result you should see the madExcept exception box for these exceptions. I don't recommend to use this approach for release software, though.
Post Reply