Logo crashrpt
A crash reporting system for Windows applications

CrAutoInstallHelper Class Reference
[CrashRpt Wrapper Classes]

Installs exception handlers in constructor and uninstalls in destructor. More...


Public Member Functions

 CrAutoInstallHelper (PCR_INSTALL_INFOA pInfo)
 Installs exception handlers to the caller process.
 CrAutoInstallHelper (PCR_INSTALL_INFOW pInfo)
 Installs exception handlers to the caller process.
 ~CrAutoInstallHelper ()
 Uninstalls exception handlers from the caller process.

Data Fields

int m_nInstallStatus
 Install status.


Detailed Description

Installs exception handlers in constructor and uninstalls in destructor.

Remarks:
Use this class to easily install/uninstall exception handlers in you main() or WinMain() function.
This wrapper class calls crInstall() in its constructor and calls crUninstall() in its destructor.

Use CrAutoInstallHelper::m_nInstallStatus member to check the return status of crInstall().

Example:

    #include <CrashRpt.h>

    void main()
    {      
      CR_INSTALL_INFO info;
      memset(&info, 0, sizeof(CR_INSTALL_INFO));
      info.cb = sizeof(CR_INSTALL_INFO);  
      info.pszAppName = _T("My App Name");
      info.pszAppVersion = _T("1.2.3");
      info.pszEmailSubject = "Error Report from My App v.1.2.3";
      // The address to send reports by E-mail
      info.pszEmailTo = _T("myname@hotmail.com");  
      // The URL to send reports via HTTP connection
      info.pszUrl = _T("http://myappname.com/utils/crashrpt.php"); 
      info.pfnCrashCallback = CrashCallback; 
      info.uPriorities[CR_HTTP] = 3; // Try HTTP first
      info.uPriorities[CR_SMTP] = 2; // Try SMTP second
      info.uPriorities[CR_SMAPI] = 1; // Try system email program last

      // Install crash reporting
      CrAutoInstallHelper cr_install_helper(&info);
      // Check that installed OK
      assert(cr_install_helper.m_nInstallStatus==0);

      // Your code follows here ...

    }

Generated on Wed Apr 29 10:17:32 2015 for CrashRpt by doxygen 1.5.9