Solved

Exception in Serializing

Posted on 2000-05-12
1
131 Views
Last Modified: 2013-11-20
In SDI application I call a function on Serialize/Load that does the following:

MyLoad(...)
{
...
  while(ar.ReadLine(s))
  {
   ...
  }
}

Still, I get a "first-chance exception" at the end of the reading, when I try to read past the end of the file. The program doesn't stop, ReadLine returns a "false" and the while loop breaks. But I get a message in the Debug window that there was an exception.

What does it mean? Should I worry about it? Why does it happen? How can I avoid it?
0
Comment
Question by:Lescha
1 Comment
 
LVL 10

Accepted Solution

by:
RONSLOW earned 10 total points
ID: 2816100
Don't think you should worry .. se the following MS KB article

INFO: First and Second Chance Exception Handling
ID: Q105675

 

--------------------------------------------------------------------------------
The information in this article applies to:

Microsoft Win32 Application Programming Interface (API), used with:
Microsoft Windows NT, versions 3.5, 3.51
Microsoft Windows 95

--------------------------------------------------------------------------------
Structured exception handling (SEH) takes a little getting used to, particularly when debugging. It is common practice to use SEH as a signaling mechanism. Some application programming interfaces (APIs) register an exception handler in anticipation of a failure condition that is expected to occur in a lower layer. When the exception occurs, the handler may correct or ignore the condition rather than allowing a failure to propagate up through intervening layers. This is very handy in complex environments such as networks where partial failures are expected and it is not desirable to fail an entire operation simply because one of several optional parts failed. In this case, the exception can be handled so that the application is not aware that an exception has occurred.

However, if the application is being debugged, it is important to realize that the debugger will see all exceptions before the program does. This is the distinction between the first and second chance exception. The debugger gets the "first chance," hence the name. If the debugger continues the exception unhandled, the program will see the exception as usual. If the program does not handle the exception, the debugger will see it again (the "second chance"). In this latter case, the program normally would have crashed had the debugger not been present.

If you do not want to see the first chance exception in the debugger, then disable the feature. Otherwise, during execution, when the debugger gets the first chance, continue the exception unhandled and allow the program to handle the exception as usual. Check the documentation for the debugger that you are using for descriptions of the commands to be used.

SUMMARY

Additional query words: 3.10 3.50 4.00


Keywords          :
Version           : winnt:3.5,3.51
Platform          : winnt
Issue type        : kbinfo
 


Last Reviewed: September 21, 1999
© 1999 Microsoft Corporation. All rights reserved. Terms of Use.
 



--------------------------------------------------------------------------------
Send feedback to MSDN.Look here for MSDN Online resources.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
sum13 challenge 24 90
abstract class with all non abstract mentods 6 76
sumHeights2  challenge 7 87
Problem to open Excel file 15 97
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now