|
|
Comments and Discussions
|
|
 |

|
What happened to part 5 ?
It does not seem to exist any more.
|
|
|
|

|
HD,
I'm checking around here in Codeproject for some information about 64-bit programming using a current install of MS Office Outlook 2007 on a Windows Server 2008 RC box. Mainly because I'm just cheesy enough not to care for the fact that Outlook upgrade no longer exists off the store shelf but mainly because everything Add-In-philic previously (in x86 and VS2005 spX) agreeable, goes south for me when using VS2010.
I know this might be a stretch, but you mention that the Outlook client that is going to send messages using XCrashReport (part5 noted) is required; or other.
That being the case, can you actually do something other than send and receive email using Outlook, like use a custom Add-In? After all ... part 05 says "64-bit".
Oil and Vinegar?
Thanks,
|
|
|
|

|
RedDK wrote: can you actually do something other than send and receive email using Outlook, like use a custom Add-In? I don't understand what you're asking. What would the custom add-in do?
|
|
|
|

|
I can't get Outlook 2007 to perform as retailers representatives suggest it should in forums geared towards creating Add-Ins using VSTO and I thought since this application XCrashReport is still using 32-bit programming with a 64-bit overhead possibility there might be an insight that I'm missing.
I'm declaring 64-bit Add-In developement officially dead wrt Outlook 2007 and Visual Studio 2010.
Thanks.
[Edit] 110526-1011
Have revived 64-bit Add-In development for Outlook 2007 using Visual Studio 2010 ... uninstalled VSTO of long ago, installed latest VSTO ... it's publishing, it's publishing, it's publishing !!!
Again, appreciate the help.
modified on Thursday, May 26, 2011 1:10 PM
|
|
|
|

|
Ah, OK.
I believe that the x64 XCrashReport would be able to be used in this situation, but I have not tried it.
|
|
|
|

|
How can i use it to report native/managed application crash? ( C++ clr )
|
|
|
|
|
|

|
Am I understanding correctly... you've decided to revoke the free v1.4 release of XCrashReport in favor of selling v2 commercially?
Personally, I have no problem supporting the continued development of this library in commercial form. My only real concern is that I cannot evaluate the code prior to purchasing a license. Just as an example, for v2 you mention that you've "Added code to prevent the CRT from forcing a call to WER (Windows Error Reporting)". I would sure like to know the specifics before buying into the new release, since I didn't think there was any sanctioned means of doing this (and most solutions I've seen floating around the Internet have limitations and/or are x86 specific).
With regard to your decision to delete "XCrashReport - Part 5" from CodeProject, I think a better move would have been to leave it there and then sell v2.x commercially moving forward. Just my opinion, of course.
- Mark R.
|
|
|
|

|
Hi Mark,
I appreciate your concerns. To be honest, I'm still in the process of getting things set up on my site, and I plan to also offer a free evaluation download (no source code) so you will be able to see for yourself how it works. Until I get that set up, I can offer to set up that evaluation download for you. The test app now has provision for testing the CRT/WER type of crash. Let me know if you'd be interested in this.
Thanks for understanding!
|
|
|
|

|
Hi Hans,
Yes, I'd be interested in evaluating the evaluation download. Thanks!
- Mark R.
|
|
|
|

|
I've been using crash reporting for a long time, mostly on Windows XP. I recently installed my application on Windows 7 and discovered that it no longer calls crash reporting. Instead I get the message about 'Your program has stopped working'. I searched the forums and there were suggestions about turning off this crash handling through the control panel and registry. I now don't get these messages, but I still don't get the crash reporting.
Any suggestions?
Dave
Dave
http://www.unit-conversion.com
http://www.essco.co.uk
|
|
|
|

|
I have been meaning to look at this. Have you been able to determine how far it gets in the crash handler?
|
|
|
|

|
Not without rebuilding the code, which isn't a straigh forward task. I could try putting Process Monitor on the machine and see if that gives me any clues.
Dave
Dave
http://www.unit-conversion.com
|
|
|
|

|
It seems like my attempts to turn off the Windows Crash reporting have failed. Process monitor shows that my applications is writing a file called Report.wer, which I guess is the Windows Error Report.
Dave
http://www.unit-conversion.com
|
|
|
|
|

|
Hi Hans and everyone.
I'm using the similar BugTrap tool also hosted here at codeproject, but like the other posters, have found that (even when I set up Windows 7 exceptions for certain programs in the Windows 7 Problem Reporting configuration dialogs), that the Windows Error Reporting stuff is trying to handle the crash before the crash handler - much as described above.
Does your version 5 fix this problem? If so, how?
Mike
|
|
|
|

|
Mike Diack wrote: Does your version 5 fix this problem? If so, how?
I can't answer that, because I've never seen that problem. I've tested on Win 7 32-bit and 64-bit.
Be sure to go to Part 5 to download.
|
|
|
|

|
Dave Moran wrote: I've been using crash reporting for a long time, mostly on Windows XP. I recently installed my application on Windows 7 and discovered that it no longer calls crash reporting.
Had the same problem and fixed it. First, I found out that exception handling didn't like compiler/linker optimisations. For some strange reason the handler was never called on Win7 (while the same executable works on Win2000/WinXP). I had to turn off most of the "aggressive" optimisations, for example do not merge sections. The generated executable file size will be bigger, but the exception handler will then works on both WinXP and Win7. Second, make sure to not write the crash report into Program Files (which probably fails under UAC), better use SHGetFolderPath() to get the application data folder and create the file there.
Hope this helps!
|
|
|
|
|

|
VC6 always creates two pdb files for an application:
<appname>.pdb
and
vc60.pdb
Do I need both for investigation of a crash mini dump with WinDbg? Or can I ignore these vc60.pdb files?
My application consists of several modules: One exe and some dll files.
For each of these modules VC6 creates its own vc6.pdb. Do I have to distinguish between these vc60.pdb files if I examine a mini dump?
Thanks for your help.
Michael
[Modified: vc60.pdb instead of vc6.pdb]
-- Modified Monday, March 29, 2010 10:49 AM
|
|
|
|

|
Can I use CExceptionHandler in commercial app, what is the licence about the CExceptionHandler class.
|
|
|
|

|
Please see CPOL license (link above).
|
|
|
|

|
This error occurs at line 941 in ExceptionHandler.cpp and I'm stumped. Has anyone experienced this error and if so, how did you overcome it? I'm new to 2008 and this error just does not make any since.
|
|
|
|
|

|
Everything seems to work with exception of the send button in the outlook composer.
Despite clicking this button, the email will not send. however, Hitting ctrl-Enter (the send shortcut) works and sends the email just fine.
Any ideas?
|
|
|
|

|
Great work - I've already found one area causing a problem in my application. However. I've encountered an odd behaviour with some crashes - the call stack seems to be wiped out when the exception occurs and when I look at the call stack the lowest function is __except_handler (which I assume is the process of jumping to the __except clause in ExceptionAttacher.cpp) and the information about where the exception occurred doesn't exist. Does anyone have any idea why this should be and how it can be fixed?
Alan
Trying to create interesting applications.
|
|
|
|

|
Did you discover why this is happening?
|
|
|
|

|
Where do I get the afxwin* headers?
|
|
|
|

|
These are the standard MFC headers.
|
|
|
|

|
Hello there
With this environment, I managed to get a clean build, but wen I try to run and click any of the buttons, the MS message comes up, BEFORE the nice dialog I expected, and the CRT takes over...
Any way to get around this?
Cheers
Alex
|
|
|
|

|
Try, in the application startup code, using SetErrorMode(SEM_NOGPFAULTERRORBOX);
Cheers,
Brett
|
|
|
|

|
The links to the previous parts of this article series are become broken. Probably the portal engine changed under the article, so replacing "*.asp" links with "*.aspx" solves the problem. This is also true for the previous parts of the series which are also refer to the other previous and next parts.
Apart from this, I really respect and appreciate this whole article series, rate to Excellent, great! This is professional! These techniques are _essential_ for _real_, _heavy_weight_ wide spreaded softwares! Thank you Hans for these articles!
|
|
|
|
|

|
First of all, a great piece of work. I have been using your project for several years now. It got my 5.
mrkmmix posted some rhetoric about Stack Overflow in 2005 and he didn't get any replies.
I am having big problems with stack overflow in some 3rd party libraries and it would be great to get the crash dumps following these. I guess the problem is that if the stack has overflown then anything in the exception handler that uses stack memory throws another exception and the application then vanishes without a trace.
I completely agree with Hans' approach of keeping the code in the exception handler to a minimum so that it has the best chance of completing its job following a serious error. It appears that the exception handler doesn't always have enough space to complete this small amount of work following a stack overflow.
Has anyone managed to work around this type of problem? I don't want to recover from the stack overflow exception... just need the crash dump. Is there any way to squeeze enough extra life from the stack to get the crash dump and report written out to disk?
Thanks for any suggestions.
|
|
|
|

|
Hi,
first of all thanks for sharing your work.
I have two questions about it. How can I use this with MFC Extensions DLL ? If it's not possible how can I debug DLL (using map files ?).
I added an error in my code and I was able to find it using dump file and your tutorial. Now I got another error (this time I didn't insert it intentionally) but when I type .ecxr I got the following line
Module load completed but symbols could not be loaded
And I couldn't get to the error.
What does this mean ?
Thanks in advance,
Stefano
|
|
|
|

|
Excellent articles!
I've got a problem using XCrashReport to send a report via Outlook and Exchange Server. The email is opened up correctly for sending, but if I click "send" I get a delivery failure report from Outlook. If I double-click on the email address of the recipient in the To box, it shows that Outlook has set the "Email Type" to the mail recipient's email address, not to "SMTP". How can I fix this please?
|
|
|
|

|
Just to help others with the same problem, I was having something similar. In order to fix it I looked at the SendMail.cpp code and there were two macros being used that needed to be changed (this is off of memory so may not be exact):
#define SEND_MAIL_TO_NAME _T("Software Support People")
#define SEND_MAIL_TO_ADDRESS _T("support@yourcompany.com")
I was able to fix it by doing the following:
#define SEND_MAIL_TO_NAME _T("support@yourcompany.com")
#define SEND_MAIL_TO_ADDRESS _T("")
Not sure why because the MAPI API call seems to be correct, but this will fix it. I didn't spend much time looking into it. You just won't have the "friendly" name that says "Software Support People", as in this case, but at least it will work.
-Jonathan
http://www.cancapture.com
|
|
|
|

|
Hello
I have used your technique to debug my program and it was working well couple of years back. But did not use it for last 2 years. Now it does not work anymore. I have my exectuable and .pdb file and crash dump file all in the same folder. When i load the crash.dmp file in WinDbg it says Symbol file could not be found.
I am using the latest version of WinDbg version no 6.8.0004.0. My compiler is Visual studio 6.0.
I just created a test crash in my program and windbg fails to report. Instead it says
*** ERROR: Symbol file could not be found. Defaulted to export symbols for mfc42.dll -
But your test program still works fine.
Please help me fix this.
Shashi
|
|
|
|

|
Excellent articles and extremely useful code. Thanks.
Anyone using these in Vista applications? Users are not allowed to write in the Program Files\AppName\ folder typically the place where the executable is kept. One could choose anothe standard location such as 'My Documents' or 'App Data' - or some how pass on the folder name to the exception handler function?
|
|
|
|

|
Have you looked inside c:\users\\AppData\Local\VirtualStore\ ?
|
|
|
|

|
Yes, I modified the code to work with Vista and privileged XP. I used the windows temp folder instead of the app folder. Unfortunately there were a quite few places to change and the code was not designed with this in mind (mostly due to reusing the module path to locate other files).
This is all a quick hack. It would be nice for someone to mod the original code, add a path passed in so any path can be used instead of windows temp, and uploaded for all. But in the spirit of sharing, here is what I did:
---
In your application stub
---
In ExceptionHandler.cpp
In RecordExceptionInfo()
after
TCHAR *pszFilePart = GetFilePart(szModuleName);
add
TCHAR szTempPathName[MAX_PATH*2];
GetTempPath(MAX_PATH*2, szTempPathName);
TCHAR* pszTempFilePath = szTempPathName + strlen(szTempPathName);
lstrcpy(pszFilePart, XCRASHREPORT_ERROR_LOG_FILE);
becomes
lstrcpy(pszTempFilePath, XCRASHREPORT_ERROR_LOG_FILE);
HANDLE hLogFile = CreateFile(szModuleName, GENERIC_WRITE, 0, 0,
becomes
HANDLE hLogFile = CreateFile(szTempPathName, GENERIC_WRITE, 0, 0,
lstrcpy(pszFilePart, XCRASHREPORT_MINI_DUMP_FILE);
becomes
lstrcpy(pszTempFilePath, XCRASHREPORT_MINI_DUMP_FILE);
HANDLE hMiniDumpFile = CreateFile(
szModuleName,
becomes
HANDLE hMiniDumpFile = CreateFile(
szTempPathName,
---
In the XCrashReport project
---
In Dlg.h
after
TCHAR m_szModulePath[MAX_PATH*2];
add
TCHAR m_szTempFilePath[MAX_PATH*2];
In Dlg.cpp
In CDlg::OnInitDialog()
after
TCHAR *cp = _tcsrchr(m_szModulePath, _T('\\'));
if (*cp)
{
*(cp+1) = _T('\0'); // remove file name
}
add
GetTempPath(MAX_PATH*2, m_szTempFilePath);
In CDlg::GetFileDetails()
CString strFilePath = m_szModulePath;
strFilePath += XCRASHREPORT_ERROR_LOG_FILE;
becomes
CString strFilePath = m_szTempFilePath;
strFilePath += XCRASHREPORT_ERROR_LOG_FILE;
strFilePath = m_szModulePath;
strFilePath += XCRASHREPORT_MINI_DUMP_FILE;
becomes
strFilePath = m_szTempFilePath;
strFilePath += XCRASHREPORT_MINI_DUMP_FILE;
In CDlg::GetRegistryDetails()
CString strFile = XCRASHREPORT_REGISTRY_DUMP_FILE;
if (!strFile.IsEmpty())
{
strFilePath = m_szModulePath;
strFilePath += strFile;
becomes
CString strFile = XCRASHREPORT_REGISTRY_DUMP_FILE;
if (!strFile.IsEmpty())
{
strFilePath = m_szTempFilePath;
strFilePath += strFile;
In CDlg::ZipFiles()
m_strZipFile = m_szModulePath;
m_strZipFile += theApp.m_pszModule;
becomes
m_strZipFile = m_szTempFilePath;
m_strZipFile += theApp.m_pszModule;
I think that was all. Make sure you test the code, log the file paths and see that files with names like: ERRORLOG.TXT, CRASH.DMP, Registry.txt, MYApp.zip end up in the correct location, and the xcrashreport.exe runs correctly.
|
|
|
|
|

|
Not sure if i ever bothered to thank you before now, but in case i forgot, here's a hearty Thanks! from someone who has benefited from your work. I've been using a modified version of this system in an internal app for close to a year now, and it has provided an excellent starting place for building our group's crash tracking and resolution system. So, in case you haven't heard it enough, you rock!
----
It appears that everybody is under the impression that I approve of the documentation. You probably also blame Ken Burns for supporting slavery.
--Raymond Chen on MSDN
|
|
|
|

|
Hi Hans Dietrich,
XCrashreport looks great! I'd love to use it, but unfortunately it does not seem to copile under VS 2005.
I just extracted the sources from codeproject, opened XCrashReport.dsp and converted it to a VS2005 project. I did not do any changes to the source code.
Upon building I got multiple compilation errors such as this one:
Error 1 error C2440: '=' : cannot convert from 'const char *' to 'LPTSTR' e:\temp\xcrashreport2\xcrashreport\xtrace.h 73
Or am I missing something?
Thanks in advance for your help!
Pluggy
|
|
|
|

|
I worked around it by changing "LPTSTR" to "LPCTSTR". I can't remember if I had to do anything else.
|
|
|
|
|

|
The function hflush and hprintf should be the following when UNICODE defined, or else we get wrong string length written to file(just half of them):
///////////////////////////////////////////////////////////////////////////////
// hflush
static void hflush(HANDLE LogFile)
{
if (hprintf_index > 0)
{
DWORD NumBytes;
WriteFile(LogFile, hprintf_buffer, lstrlen(hprintf_buffer) * sizeof(TCHAR), &NumBytes, 0);
hprintf_index = 0;
}
}
///////////////////////////////////////////////////////////////////////////////
// hprintf
static void hprintf(HANDLE LogFile, LPCTSTR Format, ...)
{
if (hprintf_index > (HPRINTF_BUFFER_SIZE-1024))
{
DWORD NumBytes;
WriteFile(LogFile, hprintf_buffer, lstrlen(hprintf_buffer) * sizeof(TCHAR), &NumBytes, 0);
hprintf_index = 0;
}
va_list arglist;
va_start( arglist, Format);
hprintf_index += wvsprintf(&hprintf_buffer[hprintf_index], Format, arglist);
va_end( arglist);
}
I added the two "* sizeof(TCHAR)"
|
|
|
|
|

|
First off, excellent series of articles and terrific application. Since there has been no response since a January posting of the same question, is it possible to generate the crash report from a thread created via AfxBeginThread? Everything is working as expect from the main thread, but nothing is created when the application crashes due to an error in another thread. Any help is appreciated.
Thank You
|
|
|
|
 |
|
|
General News Suggestion Question Bug Answer Joke Rant Admin
|
Add basic exception handling and crash reporting to your application
| Type | Article |
| Licence | CPOL |
| First Posted | 19 Oct 2003 |
| Views | 376,626 |
| Downloads | 3,458 |
| Bookmarked | 189 times |
|
|