Reporting back crashes in MFC-based products

Hello,

We have a product written in MFC using Visual Studio 7.1. We are now
planning to implement a feature that will detect a crash and report to us
the cause of the crash and other meaningful information. The plan is to
provide something similar to Window's error reporting tool.

I found a 3rd party tool for Delphi that instruments the source code. When
the program crashes, it provides information like the name of the function,
module etc.. Is there something similar that I can use with MFC?

The other option is to use MFC's Structured Exception Handling and try to
get a memory dump. However, I suppose, a map-file would be required to
properly interpret the results.

Is there a common or recommended method used by most MFC-based products for
this purpose?

Please point me to the right direction.

Thank you in advance,
Regards,
Sachin Sharma


0
2/1/2005 6:33:26 AM
vc.mfc 33608 articles. 0 followers. Follow

4 Replies
850 Views

Similar Articles

[PageSpeed] 3

There are a couple ways of doing this.  I would suggest using C++ exception 
handling to handle exceptions passed from the object CMemoryException, which 
would handle seg faults (the cause of many crashes), and possibly through 
that into the WM_KICKIDLE procedure, for idle processing, that way if a 
memory exception is happening, the app could possibly log it to a file or 
report it to the user.  The key is that it must detect the error before 
Windows finds it to my knowledge.  Once Windows sees that crash, alot of the 
time it will just close the app giving it the application no say in what is 
going on, however I am not absolutely sure.

I hope that helps.

Sincerely,
   James Simpson
0
2/1/2005 6:37:03 AM
There are 2 classes of things to consider.
1. Handle the predictable errors that you should - religiously, and
2. Cater for the unexpected.

There is a sample of a debug handler on msdn. You can code the debug handler 
quite easily to load symbols including your app symbols and take a stack 
dump to a disc file or email it. It is not a beginners task at all, but if 
you have solid Win32 its not too difficult either since the API's are well 
documented. This is IMHO the ultimate for a top end fixer upper - I wrote 
one a couple of years ago, but....

But! I found that by writing good quality code with good exception handling 
I just never got any reports of unexpected errors. The simplest solution if 
quality coding fails on you (tch tch) is to compile with a map file and make 
sure you keep it with each released version. Also compile with symbols and 
let Dr Watson do all the hand work for you as a fall back.

With CLR life is easier as all this info / functionality as at hand and 
easily available for including in your application.



"James Simpson" <JamesSimpson@discussions.microsoft.com> wrote in message 
news:73B8D1D1-8973-475C-930C-8E6A69A546EB@microsoft.com...
> There are a couple ways of doing this.  I would suggest using C++ 
> exception
> handling to handle exceptions passed from the object CMemoryException, 
> which
> would handle seg faults (the cause of many crashes), and possibly through
> that into the WM_KICKIDLE procedure, for idle processing, that way if a
> memory exception is happening, the app could possibly log it to a file or
> report it to the user.  The key is that it must detect the error before
> Windows finds it to my knowledge.  Once Windows sees that crash, alot of 
> the
> time it will just close the app giving it the application no say in what 
> is
> going on, however I am not absolutely sure.
>
> I hope that helps.
>
> Sincerely,
>   James Simpson 


0
me8291 (67)
2/1/2005 8:49:37 AM
Hi,

I have never tried to do what you are attempting but upon reading your
description, I immediately thought of SUPERASSERT.
SUPPERASSERT is a macro developed by John Robbins and discussed in both his
Windows Debugging books (which no Windows developer should be without!).

SUPERASSERT (and code) is discussed in John's Bugslayer column of MSJ here:
http://www.microsoft.com/msj/0299/bugslayer/bugslayer0299.aspx

Hopefully, it should steer you in the right direction.

Many thanks,
Andy.

"Sachin Sharma" <sachinssharma@hotmail.com> wrote in message
news:%23wy7EcCCFHA.3524@TK2MSFTNGP15.phx.gbl...
> Hello,
>
> We have a product written in MFC using Visual Studio 7.1. We are now
> planning to implement a feature that will detect a crash and report to us
> the cause of the crash and other meaningful information. The plan is to
> provide something similar to Window's error reporting tool.
>
> I found a 3rd party tool for Delphi that instruments the source code. When
> the program crashes, it provides information like the name of the
function,
> module etc.. Is there something similar that I can use with MFC?
>
> The other option is to use MFC's Structured Exception Handling and try to
> get a memory dump. However, I suppose, a map-file would be required to
> properly interpret the results.
>
> Is there a common or recommended method used by most MFC-based products
for
> this purpose?
>
> Please point me to the right direction.
>
> Thank you in advance,
> Regards,
> Sachin Sharma
>
>


0
2/1/2005 1:10:09 PM
Hello,

Thank you very much for your valuable pointers. Now I can start researching
on all these methods to find the best solution.

Regards,
Sachin Sharma


0
2/1/2005 2:48:28 PM
Reply:

Similar Artilces:

Need more Reports
GP does not provide detailed reports itself. reports such as sales by customer, best selling items, inventory valuation and so... Also the reports that it provides are not in good design and format (not useful). Is there any report package from third party that can be purchased or there is any other solution to get in depth reports and analysis? Sure Since Great Plains cannot possibly be all things to all people, get to know the layout of the Great Plains database and where all of the data is stored. Then roll your own reports using the native Report Writer, SQL Reporting Services, Cryst...

Customized CRM Report with Reporting Services
I have written a customized report in Reporting Services using SQL Server 2005. I need to use a date as one of my query parameters. I am using three parameters, one being UserName, 2) Customer, and 3) Date. I want the report to filter on the username, then customer, then date in order to provide a specific report for 1 customer and 1 date only. I changed the select for the date to: Select Distinct Convert (varchar, new_tripdate,101) in order to cut the time out of view. When I run the report, I first select the username, then I am provided with a list of customers for that user, but the...

Quality/ Productivity diagram
Hi! I'm trying to make Q/P diagram based on quality and productivity evaluation of agents in Call Centre where I work. Therefore I would like to use a scatter chart with the data shown below: agent quality productivity john 5 4 mike 4 4 dave 2 5 bob 2 1 bill 3 4 jane 5 5 jill 1 3 adam 2 4 eve 2 4 rich 3 2 I've managed to put the quality on X and productivity on Y but what I'm up to is to get the agents labeled on those coordinates. So far I only have the coordinates when click on the marker but I would like to ha...

Sales Report #3
Hi All Is there any sales report to show detailes like Store-total Sales-Cash Sales-Credit-Span-customer- Change Item/customer -Discount. Cash Sales-Credit-Span: is tender type. Change Item/customer : like one customer change item and total amount for backing item 200$ (e.g). Is there any one he have report like that? Thanks for help M. Own ...

W-2 Tax Reporting Figures Not Accurate
I use Money to monitor all of my financial situations. This year, I decided to see how it did with supplying tax information. "Poorly" is the answer. I would expect the 'Tax Line Manager / W-2 / Your salary' and the 'Tax Software Report / W-2 / Your salary' to show a figure that matches my 'W-2 / Box 1' statement information. They do not. The reason is that the 'W-2 / Box 1' statement figure has pre-tax retirement contributions subtracted from the wages. When I enter my paycheck information into Money, I categorize retirement contributions no...

Blank networth reports
Hi, Whenever I run the net worth reports, I get the hourglass for a second or two, then loading but it never renders. Other reports (Transactions, loans, cap gains, etc.) run fine. I converted from Quicken. In microsoft.public.money, <anonymous@discussions.microsoft.com> wrote: >Hi, Whenever I run the net worth reports, I get the >hourglass for a second or two, then loading but it never >renders. Other reports (Transactions, loans, cap gains, >etc.) run fine. Perhaps customize the report to a different time frame, and then reset the report? Tried all dates. >...

eXtender SOP Reports
Hello. We are using a modified version of the eXtender SOP Blank Packing Slip Form. It was modified years ago by an outside consultant. For the first time, we need to use the "Print Customer Item" option, and notice this does not work on our modified report (it works fine on the non-modified version of the same eXtender report). I am being a little lazy here and hoping someone can tell me how to turn this "feature" off or on in modifier :) Thank you, in advance. M. ...

Reports are not being shown MM07
Hi, pals! When I try to see the Monthly Reports (any month) in MM07, I get a popup saying: ------------------------------------------------------------- "File Download Do you want to open or save this file? Name: moneygen.htm Type: Firefox Document, 1,03KB From: C:\Users\yadayada [open] [Save] [Cancel] -------------------------------------------------------------- If I click OPEN, it opens the report in Firefox (!), while the Money windows says: "Navigation to the webpage was canceled. What you can try: - Retype the address" Anyone has seen it before? How to make Money o...

#Name? prints on a report when date shows up on preview
Access 2003 SP 2 Windows XP SP 2 I have created a report (rptFuelmanByForeman) that is based on a Query (qryFuelmanByForeman). I have created a form to select (or enter) a date range that then filters the report based on that date range and populates transactions between those dates. I have created two text boxes on the report that display the start date (txtStartDT) and end date (txtEndDT) entered in the date select form. The control source on the date boxes on the report is "=Forms.frmFuelmanByForeman.txtEndDate" & "...txtStartDate". In Preview mode, the dates d...

In a report, is there any way a record will change color if it's different from the previous record
Hi, I am working on a project where I need to color code the report so it will distinguish if the previous record is different from the current record. Because the record will have many similar record, so I am trying to group the record so it's easier to look. In a report, is there any way a record will change color if it's different from the previous record. Thanks for your help. richiecheng@gmail.com wrote: >Hi, I am working on a project where I need to color code the report so >it will distinguish if the previous record is different from the >current record. Because...

Saving Reports
Hi, Is there a simple way to save advanced reports for use on a monthly or weekly basis. I can produce a dynamic report but can't find a way to save this as a template so it can be run on a regular basis. Having to select all the criterea each time you want to run the report is a little annoying, I must be missing something here...? Thanks Nik Once you select all the required criteria for your search, you could click on the 'Save As' button to save the search results with some specific names. For other users to view this search result, go to the 'Saved Views' tab, ...

Launching Reports from the Submit Order Button in 4.0
My client has several retail locations and they are using CRM in conjunction with their POS system. Therefore, CRM Orders has received a lot of customization to make it as slim, trim, and "Mouse-Click-Free" as possible. In the spirit of reducing even more mouse clicks, they have asked if we could launch a custom report (Basically the Order Report, renamed "Order Receipt") when the "Submit Order" button (re-named by Scribe's CRM to GP Integration) is clicked. The Receipt would render and then be printed for the cusomter. The report is context sensitive...

To view, specifically Units in one report
I have report with a Reporting Tree (9 Unit), when the report is generated, I select only two unit, but I need that the drill down show one report with these unit only If you want multiple units in a single report you will need to use the column layout with unit restrictions on multiple columns Leslie "Pedro" wrote: > I have report with a Reporting Tree (9 Unit), when the report is generated, I > select only two unit, but I need that the drill down show one report with > these unit only Leslie; Each Column layout have the unit restrictions Thanks :-) "Lesl...

small business reports ...
Dear all Hope this is the right group. Can Mone 2002 create a Trial Balance report? Is there a list of reports availabe in 2006 (Small Business edition) that is accessible somewhere, as I have not been able to locate any such list, and is a Trial Balance one of them. While I am happy using Money and have been for some time, when it comes to reviewing my files the person doing so is a certified accountant and Quick Books user and would like me to convert, I have continued to resist however he continues to press for these accounting reports. Can Money 2002 and or 2006 Small Business ...

Crashes, "error log has been created"
Running Outlook 2000, Windows 2000. It crashes multiple times/day, taking down my box. The error message flashes too fast, but it does say an error log has been created before it goes away. Any ideas? Any ideas where to access the error log? thx, tj ...

Reporting Error ==> very urgent
Hi All, We have installed CRM 4.0 for our organization. We ahd our CRM and SQL on different servers and decided to use Mcirosoft Outlook client. The problem is when we try to generate reports we are unable to get any reports. We always getting an error stating "REPORTING ERROR REPORT CANT BE DISPLAYED" it also stats that to contact Microsoft for details. We are struck with this error for 3 days and the issue is bulging in alarming propositions. Kindly advice me to resolve and overcome this issue. Thanks a lot in advance. elays - ...

Report writer
Hello, I am trying to add the transaction distribution details onto a copy of the PM Blank Document in Report Writer in GP 9. Would you pls advise as I can add the fields containing the data but the data is not appearing on the report. Thanks your comments are appreciated. -- chj@jup Once you were done modifying the report, did you give access to the mdoified report under Security? -- Lyle U chj wrote: > Hello, > > I am trying to add the transaction distribution details onto a copy > of the PM Blank Document in Report Writer in GP 9. Would you pls > advise as I c...

Loan Accounts in Reports
Bugs are in reports, the loan that I pay to my car is divided in 2, principal and interest, but in reports I can't show the two at same time, the reports show only the interest that I'm paying. The budget have the same problem with loans, it shows values that don't exists, I start a new budget, put all the values correctly and finalize it, when I go to budget home there are values that I not put there. There is some fix to those bugs? ...

dividing a text based on a delimiter(dynamic)
i want to create a formula that breaks a list of data (in my case emails) into sets of ten or twenty. each email is delimited with commas and all the emails are contained in one cell that references a column full of singular emails in singular cells. i am so totally lost. any ideas? Hi! Help me. What exactly does "all the emails are contained in one cell that references a column ful of singular emails in singular cells" mean? Al -- Message posted from http://www.ExcelForum.com Here is what happens, I have a cell with "email1@blah.org,email2@bleh.com,email3@bluh.ne...

Auto Back Up other than FDD
When I shut the program down I get the "Back Up to FDD" prompt but I want to back up to CD. Can this be done ? The 'Options' button only then gives me the choice to auto back up to FDD with a 'save in' option only of Removable Disk - (A:) witha scroll down of nothing else . How do I get it to go to a CD? And the files that are auto backed up to HDD - how do I restore these? as I can see the format is specific to the Money 2001. Cheers Mike You need to backup to hard disk and then use CD writing software to write to the CD. It is an operating system function not ...

Monthly reports in Money 2004 Standard
Is there a way to customize the categories used to compose the Monthly Reports? I would like to omit my business travel and living expenses from these reports, as they are fully reimbursed, and have nothing to do with my household finances. Can this be done in 2004? If not, has this feature been rolled into newer versions? Monthly reports are not customizable in any version of Money that is in the wild. "bob2246" <bob2246@discussions.microsoft.com> wrote in message news:3493CA51-596F-4D59-9540-F2D79EA5A618@microsoft.com... > Is there a way to customize the categor...

Reprinting/Reporting Past Z Reports
Hi all ~ Just wondering how to pull up a past Z report? Which database table(s) are used? Is there a sql for this so that I can pull up a week or months Z reports in a sql query? Thanks Jerry Jerry, In POS, F4, Batch button, find and double click on the batch you want, page down to the z-out, print. In Manager, Journal, View, find and double click on the batch you want, page down to the zout, print. -- * "Jerry Penna" <jerrypenna@msn.com> wrote in message news:3ac97809.0410011320.1b034dd9@posting.google.com... Hi all ~ Just wondering how to pull up a past Z rep...

Create contact-list based on Active Directory attributes ?
We have Outlook 2002 sp2/sp3, Exchange 2003 sp2 and an Active Directory 2003 sp2. I wonder if it's possible to create a contact-list based on Active Directory attributes ? It could be a mailbox contact or shared maps contact Or if above are not possible, can you import an Excelsheet with phonenumbers into a contact list ? Sincerely \\Jonas B you can connect to it using LDAP. If you need specifics on how to do this, you'll need to ask in the exchange server or active directory newsgroups. -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Ho...

Displaying Filter Criteria In Report Header?
I have one report layout "rptStandard" that when it is opened I would like to display the filter criteria in the header. Is there a way to do this? You can put this into the ControlSource of a text box: =[Report].[Filter] Trouble is, sometimes the Filter property contains an artifact from a previous filter, even though the filter is not applied. On a form you could sort this out by testing the FilterOn property, but Access doesn't maintain this property reliably for reports. A better solution is to pass the filter to the report in its OpenArgs (or use a public string...

synchronising Outlook 2007 contacts with backed up version
Hi all, I use Win XP Pro with a Nokia 'smartphone'. In early December, Nokia invited me to download and install a new synchronisation package that truncated some of the entries in my Outlook 2007 including the longer Notes fields in my Contacts; I don't know what else I lost, but some 200 entries were affected. I had mirrored my HDD prior to this, and would like to use this archive to recover the lost data. When the Outlook field on my computer incorporates newer information than the mirrored version, I would like this incorporated. As Nokia has not replied...