crashrpt | ||
A crash reporting system for Windows applications |
Assume it is required to remotely debug some application logics error. Such an error, for example, infinite loop in a worker thread, may not cause program crash. To collect the information about error that doesn't cause crash, a software developer might provide an ability to generate error report manually on user demand, for example on a key combination press.
The crGenerateErrorReport() function allows to generate an error report manually. When you generate an error report manually, the caller process is not terminated and continues its execution. To send the error report, CrashRpt creates another process named CrashSender.exe.
__try/__except
construction) and generate error report when an exception happens. CrashRpt provides a conveniense function crExceptionFilter() for this purpose.For additional information on SEH exceptions, please refer to About Exceptions and Exception Handling page.
The silent mode is designed for server applications or services that do not need to interact with user on crash. The silent mode should not be used for regular GUI applications. For regular interactive applications, a user should provide his/her consent to allow sending the error report.
You can pass command line parameters to the executable being restarted using CR_INSTALL_INFO::pszRestartCmdLine, but can't specify another executable for restart. Only the same executable can be restarted that was used to start the current process.
By default, the application is restarted only if at least 60 seconds have elapsed since its start up. This is done to avoid cyclic restarts of an application that crashes right on its start up. (Also, the application is restarted only if the user does provide his/her consent.) You can override the default restart timeout (in seconds) using the CR_INSTALL_INFO::nRestartTimeout structure field.
If you generate an error report manually with automatic restart feature enabled, the caller process is not terminated automatically and another instance of client application is launched. If you want to avoid starting the second instance of the client application, specify the CR_EXCEPTION_INFO::bManual flag.
You can specify custom icon for CrashRpt dialogs by specifying CR_INSTALL_INFO::pszCustomSenderIcon structure member. The value of this parameter should be absolute path to the module containing the icon resource, followed by resource identifier separated by comma. For example, specifying this with "C:\\WINDOWS\\System32\\user32.dll, 1" results in the following appearance (see the figure below).
Custom Icon
Sending Error Report Mandatory
Showing User E-mail and Problem Description Fields
As of v.1.3.1, CrashRpt allows to specify a command line parameter /terminate for CrashSender.exe. This resolves a problem with installers that will want to update or remove the EXE file during software installation process. Earlier, there was no way to programmatically tell the CrashSender.exe program to exit immediatelly.
Launching "CrashSender.exe /terminate" from command shell would look for all open CrashSender.exe processes and terminate them immediately (without sending crash reports or waiting for completion). Terminating the process is acomplished with TerminateProcess() function.
Further reading: An Example of Using CrashRpt API.