GME  13
Public Member Functions | Public Attributes
CrAutoInstallHelper Class Reference

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

#include <CrashRpt.h>

List of all members.

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.

Public Attributes

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 ...

    }

Definition at line 1546 of file CrashRpt.h.


Constructor & Destructor Documentation

Installs exception handlers to the caller process.

Definition at line 1551 of file CrashRpt.h.

Installs exception handlers to the caller process.

Definition at line 1557 of file CrashRpt.h.

Uninstalls exception handlers from the caller process.

Definition at line 1563 of file CrashRpt.h.


Member Data Documentation

Install status.

Definition at line 1569 of file CrashRpt.h.


The documentation for this class was generated from the following file: