How to notify the user...

delphi package - automated exception handling
Post Reply
Zapato
Posts: 5
Joined: Tue May 30, 2006 6:35 pm

How to notify the user...

Post by Zapato »

Hi, I use RegisterExceptionHandler to send additional attachments to bug report and it works fine. How can I notify the user that the bug report was sent succesfully to our email server? I send bug report by smtp as smtp client.
thanks.
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

Well, basically you can call "madExcept.RegisterExceptActionHandler". Then when the "eaSendBugReport" action is notified, set "handled := true" and do the mailing yourself. After the mailing succeeded, just show a message box. You can do the mailing by calling "madExcept.SendBugReport".
Zapato
Posts: 5
Joined: Tue May 30, 2006 6:35 pm

Post by Zapato »

I'm not using the madExcept component. I use a conditional compile to include the units then apply the madexceptpatch. So, I use RegisterExceptionHandler just to modify the settings at runtime: e-mail, username, password, etc and let madExcept to send the bug report by email. After sending the report, I need to notify the user that email has been sent. How can I get access to OnExceptAction if i don't have the component on the form ? Thank you.
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

You said you're calling RegisterExceptionHandler. In the same way you can call RegisterExceptActionHandler. Please reread my previous comment. I was not talking about using the madExcept component. What I said there is still valid. You can do all that at runtime, regardless of whether you're using madExceptPatch or not.
Zapato
Posts: 5
Joined: Tue May 30, 2006 6:35 pm

Post by Zapato »

My fault, sorry. In the initialization part of the unit i have
RegisterExceptActionHandler(MyActionHandler,stDontSync);

Then i have:

procedure MyActionHandler(Action:TExceptAction;
const exceptIntf : IMEException;
var handled : boolean);
var bTRansmited:TextBool;
begin
if Action=eaSendBugReport then
begin
// MESettings for smtp client
bTRasmited = madexcept.SendBugReport ('',exceptintf.ScreenShot,0,madexcept.MESettings);
if boolean(bTransmited) then
MessageBox(0, 'Bug reported successfully!', '', MB_ICONINFORMATION or MB_OK);
end;
end;

The problem is that the mesagebox shows up BEFORE the SendbugReport finishes its job. What can I do to notify to user AFTER the bug is sent ? Thank you!
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

Make sure you deactivate the option "send bug report in background". See here:

http://help.madshi.net/madExceptSettings5.htm
Post Reply