This page contains several examples of using CrashRptProbe API described in Using CrashRptProbe API.
Opening Error Report
The following example shows how to open an error report file:
_T("0b3b0c1b-3450-4c39-9459-42221ae66460.zip"),
_T("2e4345603454a345064371ab34195316"),
_T("D:\\MyApp\\1.3.4\\Sym; D:\\MyApp\\1.3.5\\Sym"),
0,
&hReport
);
if(nResult!=0)
{
TCHAR szErrorMsg[256];
return;
}
Getting Row Count in a Table
The following example shows how to get count of rows in a table.
#include <assert.h>
assert(nRowCount==1);
Getting Miscellaneous Information about Error Report
The following example shows how to get miscellaneous information from CRP_TBL_XMLDESC_MISC and CRP_TBL_MDMP_MISC tables.
const int BUFF_SIZE = 1024;
TCHAR szBuffer[BUFF_SIZE];
int nExceptionThreadRowId = _ttoi(szBuffer);
if(nResult==0)
{
}
Enumerating Threads and Loading Stack Trace for Each Thread
#include <assert.h>
int i;
for(i=0; i<nThreadCount; i++)
{
const int BUFF_SIZE = 1024;
TCHAR szThreadID[BUFF_SIZE];
TCHAR szStackTableID[BUFF_SIZE];
TCHAR szBuffer[BUFF_SIZE];
assert(nResult==0);
assert(nResult==0);
int j;
for(j=0; j<nFrameCount; j++)
{
if(nResult==0)
{
int nModuleRowID = _ttoi(szBuffer);
}
assert(nResult==0);
if(_tcscmp(szBuffer, _T(""))!=0)
{
}
else
{
}
}
}
Enumerating Loaded Modules
The following examples shows how to enumerate loaded modules.
#include <assert.h>
int i;
for(i=0; i<nRowCount; i++)
{
const int BUFF_SIZE = 1024;
TCHAR szBuffer[BUFF_SIZE];
assert(nResult==0);
assert(nResult==0);
assert(nResult==0);
}
Enumerating and Extracting Files Contained in Error Report
The following example shows how to enumerate files contained in the error report and extract them.
#include <assert.h>
int i;
for(i=0; i<nRowCount; i++)
{
const int BUFF_SIZE = 1024;
TCHAR szBuffer[BUFF_SIZE];
if(nResult==0)
{
}
assert(nResult==0);
}