madshi.net Forum Index madshi.net
high quality low level programming
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Generating a bug report on demand using ME project settings

 
Post new topic   Reply to topic    madshi.net Forum Index -> madExcept
View previous topic :: View next topic  
Author Message
rossmcm



Joined: 09 Jun 2005
Posts: 15

PostPosted: Thu Jul 22, 2010 12:26 am    Post subject: Generating a bug report on demand using ME project settings Reply with quote

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
View user's profile Send private message Visit poster's website
rossmcm



Joined: 09 Jun 2005
Posts: 15

PostPosted: Thu Jul 22, 2010 6:29 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    madshi.net Forum Index -> madExcept All times are GMT
Page 1 of 1

 
Jump to:  
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