callback for LastMantisIssueId after bugreport send

delphi package - automated exception handling

callback for LastMantisIssueId after bugreport send

Postby nemopeti » Tue Feb 27, 2018 10:36 am

Hello,

How can I got the LastMantisIssueId value, after the user clicked the send button on the madExcept dialog.
I neet to show the send bug ID back to the user in a message box.

I try to find a callback like 'AfterBugReportSend' or something, but I can't find.
nemopeti
 
Posts: 10
Joined: Thu Feb 01, 2018 2:05 pm

Re: callback for LastMantisIssueId after bugreport send

Postby madshi » Tue Feb 27, 2018 4:24 pm

You can use RegisterExceptActionHandler. See here:

Code: Select all
type
  // enumeration for the exception action events
  TExceptAction = (eaSendBugReport,  eaSaveBugReport,  eaPrintBugReport,   // before assistant
                   eaSendBugReport2, eaSaveBugReport2, eaPrintBugReport2,  // after assistant
                   eaSendBugReport3, eaSaveBugReport3, eaPrintBugReport3,  // after sending/saving/printing
                   eaShowBugReport,
                   eaHelp,
                   eaContinueApplication, eaRestartApplication, eaCloseApplication);
madshi
Site Admin
 
Posts: 9790
Joined: Sun Mar 21, 2004 5:25 pm

Re: callback for LastMantisIssueId after bugreport send

Postby nemopeti » Wed Feb 28, 2018 1:32 pm

ok, now I can catch the event, but, how can I access the LastMantisIssueId varible content?
nemopeti
 
Posts: 10
Joined: Thu Feb 01, 2018 2:05 pm

Re: callback for LastMantisIssueId after bugreport send

Postby madshi » Wed Feb 28, 2018 1:33 pm

Simply add "madExcept" to the uses clause, then you can access "LastMantisIssueId" directly.
madshi
Site Admin
 
Posts: 9790
Joined: Sun Mar 21, 2004 5:25 pm

Re: callback for LastMantisIssueId after bugreport send

Postby nemopeti » Wed Feb 28, 2018 1:57 pm

wow, almost perfect, just one more thing.
How can I close the madexcept dialog, from code.

the flow, I like to make:

exception occures -> madexcept dialog shown -> user clicked the send report button -> after the report successfuly send close madexcept dialog adn showmessage the bug ID
nemopeti
 
Posts: 10
Joined: Thu Feb 01, 2018 2:05 pm

Re: callback for LastMantisIssueId after bugreport send

Postby madshi » Wed Feb 28, 2018 2:03 pm

You can use madExcept.GetExceptBoxHandle() to get the win32 "HWND" handle of the exception box. I suppose you could try posting WM_CLOSE to it. Not sure if that would work. Alternatively you could use FindWindowEx() to browse through the child windows to get the handle of the "continue application" button and send a message to it to "press" the button.

Please make sure that the GUI you're using to show the Mantis ID is thread safe. The VCL is not thread safe. You could use the win32 API "MessageBox()". Make sure it's "Windows.MessageBox()", just to be safe it's not some VCL variant.
madshi
Site Admin
 
Posts: 9790
Joined: Sun Mar 21, 2004 5:25 pm

Re: callback for LastMantisIssueId after bugreport send

Postby nemopeti » Wed Feb 28, 2018 2:18 pm

seems perfect, extra thenks for the threadsafe tip!
nemopeti
 
Posts: 10
Joined: Thu Feb 01, 2018 2:05 pm


Return to madExcept

Who is online

Users browsing this forum: No registered users and 4 guests