 |
madshi.net high quality low level programming
|
| View previous topic :: View next topic |
| Author |
Message |
rossmcm
Joined: 09 Jun 2005 Posts: 15
|
Posted: Thu Jul 22, 2010 12:26 am Post subject: Generating a bug report on demand using ME project settings |
|
|
I'm trying to add a function to send a diagnostic report on demand. I have the ME settings in the IDE configured to use SMTP client (not MAPI) and attach various files and a screenshot. It works when we get an exception. When I generate a report on demand however, it forgets those settings and seems to use the defaults (only attach bugreport and screenshot, use MAPI)
What's wrong with my code?
| Code: | procedure SendDiagnosticsReport ;
var
BugReportString : string ;
begin
BugReportString := CreateBugReport (etHidden) ;
MESettings.AttachBugReportFile := True ; // attach bug report file
MESettings.BugReportSendAs := 'Diagnostics Report.txt' ; // bug report send as
MESettings.BugReportZip := 'Diagnostics Report.zip' ; // bug report zip
MESettings.ScreenShotSendAs := 'Diagnostics Screenshot.png' ; // screen shot send as
MESettings.ScreenShotZip := 'Diagnostics Report.zip' ; // screen shot zip
MESettings.AdditionalAttachments.Add (GetGlobalINIFileID, ExtractFilename (GetGlobalINIFileID), 'Diagnostics Report.zip', '') ;
if (SendBugReport (BugReportString, ScreenShot, 0, MESettings) = Yes) then
begin
ShowMessage ('Diagnostics report has been sent') ;
end
else
begin
MessageDlg ('Diagnostics report could not be sent', mtError, [mbAbort], 0) ;
end ;
end ;
|
TIA,
Ross |
|
| Back to top |
|
 |
rossmcm
Joined: 09 Jun 2005 Posts: 15
|
Posted: Thu Jul 22, 2010 6:29 am Post subject: |
|
|
Don't panic. It works after all. I think that ME wasn't patching the EXE when I was compiling from the IDE - a problem I have where the EXE stays open for a long time after the link and ME can't patch it.
Anyway
| Code: | procedure SendDiagnosticsReport ;
var
BugReportString : string ;
begin
BugReportString := CreateBugReport (etHidden) ;
if (SendBugReport (BugReportString, ScreenShot, 0, MESettings) = Yes) then
begin
ShowMessage ('Diagnostics report has been sent') ;
end
else
begin
MessageDlg ('Diagnostics report could not be sent', mtError, [mbAbort], 0) ;
end ;
end ;
|
worked, just as Mathias said it would.
R |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|