madExcept, services and HandleException

delphi package - automated exception handling
Post Reply
rgomez
Posts: 11
Joined: Wed May 19, 2010 5:08 pm
Location: México

madExcept, services and HandleException

Post by rgomez »

Hello,

I wonder what's the status of madExcept and Windows Services?

I have read some other posts that instruct to disable the showing of the report box in case it is a Windows service (I am talking of non-interactive ones), but I don't know if this has changed lately? I am guessing it doesn't, as I think I have some cases where after an exception things went bad as the service was waiting for the exception box to be closed.

I have several places in my apps where I call directly HandleException. I do this to avoid the "unhandled" exception (it is being handled after all) and to be able to log the details and display it to the user. I had the idea that in the case of services the box would not be displayed, only the exception saved, but I think some of the strange problems I've got are because MadExcept::HandleException is actually displaying a dialog.

If that's the case then it's ok, just need to disable it and that's it. I guess this is possible from within the code itself, using the MESettings() function?

Thanks!
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: madExcept, services and HandleException

Post by madshi »

I suppose you already have configured madExcept to not show the exception box, by changing the combobox in "exception filter -> all other exception classes" to "don't show anything"? Ideally also disabled "show please wait box"?

If you've configured madExcept that way, then no box should ever be shown - unless you manually ask for it. Calling HandleException() will just tell madExcept to analyze an exception, it will show obey your configuration. So calling HandleException() will not show a box, if your settings are configured correctly.
rgomez
Posts: 11
Joined: Wed May 19, 2010 5:08 pm
Location: México

Re: madExcept, services and HandleException

Post by rgomez »

No, I haven't configured madExcept to not show the exception box, until yesterday. I had the incorrect idea that it will not show the exception box if it was running as a service.

I have changed the settings, by code (some services can run also as a normal app). I'll try producing some exceptions by hand just to make sure things are as they should, but now that I know what I was doing wrong things make sense.

Thanks!
Post Reply