<!-- This comment will put IE 6, 7 and 8 in quirks mode -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="icon" href="../favicon.ico" type="image/x-icon" />
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>CrashRpt: Getting Started</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<table border="0" bgcolor="#FFFFFF" cellspacing="5" width="100%">
<tr>
<td width="24px" rowspan="2"><img src="../logo.png" alt="Logo" /></td>
<td><font family="Arial" size="+2">crashrpt</font></td>
<td rowspan="2" align="right"><a href="http://sourceforge.net/donate/index.php?group_id=279722"><img src="../donate_small.png" alt="Donate" /></a></td>
</tr>
<tr>
<td colspan="2"><i>A crash reporting system for Windows applications</i></td>
</tr>
</table>
</body>
<!-- Generated by Doxygen 1.5.9 -->
<script type="text/javascript">
<!--
function changeDisplayState (e){
var num=this.id.replace(/[^[0-9]/g,'');
var button=this.firstChild;
var sectionDiv=document.getElementById('dynsection'+num);
if (sectionDiv.style.display=='none'||sectionDiv.style.display==''){
sectionDiv.style.display='block';
button.src='open.gif';
}else{
sectionDiv.style.display='none';
button.src='closed.gif';
}
}
function initDynSections(){
var divs=document.getElementsByTagName('div');
var sectionCounter=1;
for(var i=0;i<divs.length-1;i++){
if(divs[i].className=='dynheader'&&divs[i+1].className=='dynsection'){
var header=divs[i];
var section=divs[i+1];
var button=header.firstChild;
if (button!='IMG'){
divs[i].insertBefore(document.createTextNode(' '),divs[i].firstChild);
button=document.createElement('img');
divs[i].insertBefore(button,divs[i].firstChild);
}
header.style.cursor='pointer';
header.onclick=changeDisplayState;
header.id='dynheader'+sectionCounter;
button.src='closed.gif';
section.id='dynsection'+sectionCounter;
section.style.display='none';
section.style.marginLeft='14px';
sectionCounter++;
}
}
}
window.onload = initDynSections;
-->
</script>
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Contents</span></a></li>
<li><a href="modules.html"><span>API Reference</span></a></li>
<li><a href="files.html"><span>File Reference</span></a></li>
<li>
<form action="search.php" method="get">
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td><label> <u>S</u>earch for </label></td>
<td><input type="text" name="query" value="" size="20" accesskey="s"/></td>
</tr>
</table>
</form>
</li>
</ul>
</div>
<div class="navpath"><a class="el" href="index.html">CrashRpt Documentation</a> » <a class="el" href="introduction_to_crashrpt.html">Introduction to CrashRpt</a>
</div>
</div>
<div class="contents">
<h1><a class="anchor" name="getting_started">Getting Started </a></h1>If you have ever tried to determine the reason why your program crashes on user's machine, you might know how difficult it is, given user's directions only: "I opened something, then I clicked something and then it stopped working". Most of users won't contact you to tell about the problem and just give up using your program after several crashes. Users who decide to report the problem might not have technical knowledge, so it is difficult to determine the reason of the problem based on their instructions. This makes debugging remote crashes almost impossible, except in the simplest situations. This fact encourages to use some tools to automatically collect technical information about the crash and send error report over the Internet.<p>
Now assume you receive tons of error reports from users of your software. You would have to spend a lot of time to open each report, analyze its contents and write some summary about the report. There may be many reports related to the same problem, so opening such reports doesn't tell anything new. After the 50th report you may become bored and give up further analysis. In the best case, you would analyze only part of reports selected randomly, which guarantees you miss some rarely reported crashes.<p>
That's why it is important to use special tools to report errors automatically and tools that help you to post-process arriving error reports.<h2><a class="anchor" name="wer_and_breakpad">
Approaches to Error Reporting</a></h2>
First let's review a couple of well-known approaches to the crash handling, reporting & post-processing problem: WER and Breakpad. Then we present our approach, CrashRpt - an open-source error handling, reporting and post-processing library, which is designed specially for Windows applications created in Microsoft Visual C++.<p>
<b>Windows Error Reporting.</b> Every PC user might have seen the window of Dr.Watson, the Windows' default debugger introduced in Windows XP. Dr. Watson is able to intercept unhandled SEH (Structured Exception Handling, SEH) exceptions in user-mode programs, and in OS modules. It collects technical information about the problem (minidump and textual description) and offers user to send the info to Microsoft's server. The developer can browse arriving error reports by registering on this server (digital certificate is required). The disadvantage of Dr. Watson is inability to use third-party server for storing error reports and inability to customize debugger's user interface and report's content.<p>
In Windows Vista, the Dr.Watson was renamed into <a href="http://en.wikipedia.org/wiki/Windows_Error_Reporting">Windows Error Reporting (WER)</a>. The API allowing to customize error reports was introduced and documented in MSDN. You can use the API to add (or not add) minidump, log file, memory block to the report, modify user interface appearance, queue report submission or send it immediately (after user's consent). You can ask WER to start data recovery operation when you app crashes, and even to restart your app. When a non-critical error happens, you can create error report manually. WER can also notify user if the solution of the problem is already known.<p>
Advantages of WER:<p>
<ul>
<li>Native to Windows (no need to distribute), has well-developed functionality (it has been developed for over 10 years now) and well-documented in MSDN</li><li>Allows to customize contents of the error report</li><li>Has sophisticated online error report processing services on their Watson server</li></ul>
<p>
Disadvantages of WER:<p>
<ul>
<li>It is not an open-source software</li><li>Requires you to have digital certificate to access your error reports (costs about USD1500)</li><li>Doesn't allow to use your own server to store error reports</li></ul>
<p>
<b>Google Breakpad.</b> An alternative of WER is <a href="http://code.google.com/p/google-breakpad/">Google Breakpad</a>. This open-source tool is used in Mozilla Firefox and Google Chrome browsers. Breakpad is an open-source cross-platform C++ library designed for handling exceptions in your program and sending reports to your server over HTTP or HTTPS connection. It also provides tools for post-processing minidumps which present stack traces and other information in human-readable form. Windows (x86) and Mac OS (x86 and PowerPC) platforms are supported. Also (at the moment of writing this text) an experimental version for Linux exists.<p>
When an exception happens, Breakpad creates minidump file and delegates further actions to a user-provided callback function. The function may silently terminate the program or add custom files to the report and launch report sender program. Breakpad provides C++ classes implementing minidump processing functionality which can be used for writing your custom minidump post-processing tools.<p>
Advantages of Breakpad:<p>
<ul>
<li>Breakpad is an open-source software</li><li>It is used in Firefox and Chrome, which means it is wide-spread and well-tested</li><li>It supports multiple platforms: Windows, Mac and Linux</li><li>Supports multiple C/C++ compilers, e.g. GCC, MS Visual C++</li><li>It allows to transfer error reports through HTTPS to your own server</li></ul>
<p>
Disadvantages of Breakpad:<p>
<ul>
<li>It is being developed for all possible platforms and compilers (they are unable to develop a tool which will work well everywhere, it is too much efforts needed)</li><li>Breakpad is not well-suited to Visual C++. For example, it doesn't handle some CRT errors (at the moment of writing this text).</li><li>It uses cross-platform format for storing debugging symbols (instead of PDB files). It makes you to convert PDB files into this format.</li></ul>
<p>
<b>Summary.</b> As we see, WER and Breakpad are wide-spread error reporting and processing tools. But WER requires you to purchase a digital certificate, which may be costly. Breakpad is free, but you have to convert debugging info into cross-platform format. And Breakpad doesn't suit well to Visual C++, e.g. it doesn't handle some CRT errors. So, if you write a program for Windows platform only and use Visual C++ only, you might find the CrashRpt library described below more convenient.<h2><a class="anchor" name="about_crashrpt">
About CrashRpt</a></h2>
<b>CrashRpt</b> library is a set of open-source error handling, reporting and post-processing tools for applications created in Microsoft Visual C++ and running in Windows. It supports only one OS (Windows), only one programming language (C++) and only one compiler (Visual C++). This allows to assume it knows all aspects of this environment.<p>
<ul>
<li>Although CrashRpt is not designed for platforms other than Windows, it handles Visual C++ exceptions better than Breakpad (because CrashRpt designed specially for Visual C++).</li></ul>
<p>
<ul>
<li>CrashRpt supports Visual C++ .NET 2003, 2005, 2008, 2010 and Visual C++ Express. It can be compiled for 32-bit and 64-bit platform.</li></ul>
<p>
<ul>
<li>CrashRpt handles exceptions in the main thread or in a worker thread of your user-mode program: SEH exceptions, CRT errors and signals.</li></ul>
<p>
<ul>
<li>CrashRpt generates error report including crash minidump, extensible crash description XML, application-defined files and desktop screenshots. CrashRpt uses Microsoft Debug Help library for minidump creation and post-processing, which makes it more stable on all variety of processor architectures.</li></ul>
<p>
<ul>
<li>CrashRpt presents UI allowing user to review the crash report. Supports privacy policy definition. Can display its UI using different languages, which makes it even more suitable for multi-lingual applications.</li></ul>
<p>
<ul>
<li>CrashRpt sends the report in background after user has provided his/her consent. CrashRpt can send error reports not only using HTTP, but also using E-mail. Sending through E-mail is suitable for users not having servers for storing error reports. But, in order to send reports over E-mail, user's machine should have a mail program installed, for example Mozilla Thunderbird or Microsoft Outlook.</li></ul>
<p>
<ul>
<li>CrashRpt has a tool for error reports' post processing. The tool may be useful when you receive hundreds of reports a day and need to process them all at once.</li></ul>
<p>
<ul>
<li>One disadvantage of CrashRpt is the fact that you have to distribute additional binaries (<b>dbghelp.dll</b>, <b>CrashRpt.dll</b>, <b>CrashSender.exe</b>) with your software (about 1.5 Mb).</li></ul>
<h2><a class="anchor" name="chlog">
What's New in Current Version</a></h2>
The change log is available <a href="../../Changelog.txt">here</a><h2><a class="anchor" name="download">
Download</a></h2>
The latest stable version of CrashRpt is available on <a href="http://code.google.com/p/crashrpt">CrashRpt project page</a><h2><a class="anchor" name="license">
License</a></h2>
This library is distributed under the <a href="../../License.txt">New BSD license</a>. Other software included in CrashRpt distribution is provided under other licenses, as listed in the table below.<p>
<table border="1" cellspacing="3" cellpadding="3">
<tr>
<td><b>Name</b> </td><td><b>License</b> <p>
</td></tr>
<tr>
<td><a href="http://sourceforge.net/projects/wtl/">WTL</a> </td><td><a href="http://opensource.org/licenses/ms-pl.html">Microsoft Permissive License</a><p>
</td></tr>
<tr>
<td><a href="http://msdn.microsoft.com/en-us/library/ms679309%28VS.85%29.aspx">Microsoft Debug Help Library</a> </td><td><a href="http://msdn.microsoft.com/en-us/library/ms679309%28VS.85%29.aspx">Microsoft Software License Terms for Microsoft Debugging Tools for Windows</a><p>
</td></tr>
<tr>
<td><a href="http://www.grinninglizard.com/tinyxml/">TinyXml</a> </td><td><a href="http://en.wikipedia.org/wiki/TinyXML">licence of zlib/libpng</a><p>
</td></tr>
<tr>
<td><a href="http://www.zlib.net/">ZLib</a> </td><td><a href="http://www.gzip.org/zlib/zlib_license.html">zlib license</a><p>
</td></tr>
<tr>
<td><a href="http://www.winimage.com/zLibDll/minizip.html">minizip</a> </td><td><a href="http://www.gzip.org/zlib/zlib_license.html">zlib license</a><p>
</td></tr>
<tr>
<td><a href="http://www.libpng.org/pub/png/libpng.html">libpng</a> </td><td><a href="http://www.libpng.org/pub/png/src/libpng-LICENSE.txt">libpng license</a><p>
</td></tr>
<tr>
<td><a href="http://www.ijg.org/">JPEG library</a> </td><td><a href="http://www.ijg.org/">Independent JPEG Group license</a> </td></tr>
</table>
<h2><a class="anchor" name="install_faq">
FAQ</a></h2>
<b>Where do I look for answers to frequently asked questions about CrashRpt?</b><p>
You can find a lot of information about CrashRpt in our <a href="http://code.google.com/p/crashrpt/wiki/FAQ">online FAQ</a><p>
<b>How do I report a bug or request a new feature?</b><p>
If you detect an issue or want to request a new feature, please create an issue at the <a href="http://code.google.com/p/crashrpt/issues/list">Issues</a> page.<p>
If you would like to contribute or ask a question, create a topic in our <a href="http://groups.google.com/group/crashrpt/topics">Forum</a>.<p>
<b>I found a bug in CrashRpt.dll or in CrashSender.exe (it crashes itself :)) and want to debug it in Visual C++ to determine the reason of the problem. What to I do?</b><p>
Its easy to run CrashRpt.dll code in step-by-step debugging mode. Just trigger an exception in the application. But there may be a problem if Visual C++ doesn't allow you to debug after exception had occurred. To workaround this, generate error report manually without exception, using <a class="el" href="group___crash_rpt_a_p_i.html#g60af60c28c64a1d3baa11f1220b9c3f4" title="Manually generates an errror report.">crGenerateErrorReport()</a> function. This way you should be able to debug.<p>
If the code in CrashRpt.dll works fine, but CrashSender.exe crashes, you need to attach to CrashSender.exe process when it is launched. In Visual C++ window, open Debug | Attach to process... menu and select CrashSender.exe in the list of processes. Then you will be able to run the code in step-by-step debugging mode.<p>
<b>Can I use crashrpt in an MFC-based application? ATL/WTL-based application? WinAPI application?</b><p>
Yes, you can use CrashRpt in a Visual C++ project using any of the technologies: MFC, ATL/WTL or pure WinAPI.<p>
<b>Can I use crashrpt in a commercial application?</b><p>
According to New BSD licence, you can freely use CrashRpt in any application.<p>
<b>Should I give credits if my application uses crashrpt?</b><p>
The New BSD License clearly states that an application that distributes CrashRpt in compiled (binary) form must reproduce the copyright notice, the list of conditions and the disclaimer in the documentation and/or other materials provided with the distribution.<p>
<b>How do I show my appreciation of CrashRpt project?</b><p>
If you like CrashRpt and use it in your software, you can show your appreciation by adding your project name and logo to the <a href="http://code.google.com/p/crashrpt/wiki/WhoUsesCrashRpt">WhoUsesCrashRpt</a> page. By doing this you make CrashRpt more significant for other users and support further development. </div>
<hr size="1"><address style="text-align: right;"><small>Generated on Sat Oct 22 17:37:43 2011 for CrashRpt by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.9 </small></address>
</body>
</html>