First Chance Exception 
Author Message
 First Chance Exception

While running a C++ program in Visual studi, I see hundreds of messages in the
Debug Window related "First Chance Exception in ...". What is this First chance
exception??


Tue, 08 Jul 2003 06:44:42 GMT  
 First Chance Exception
Hi,

look at the following MSDN article

INFO: First and Second Chance Exception Handling

----------------------------------------------------------------------------
----
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 de{*filter*} will see all exceptions before the program does. This is
the distinction between the first and second chance exception. The de{*filter*}
gets the "first chance," hence the name. If the de{*filter*} continues the
exception unhandled, the program will see the exception as usual. If the
program does not handle the exception, the de{*filter*} will see it again (the
"second chance"). In this latter case, the program normally would have
crashed had the de{*filter*} not been present.

If you do not want to see the first chance exception in the de{*filter*}, then
disable the feature. Otherwise, during execution, when the de{*filter*} gets the
first chance, continue the exception unhandled and allow the program to
handle the exception as usual. Check the documentation for the de{*filter*} 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
Technology :

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

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

While running a C++ program in Visual studi, I see hundreds of messages in
the
Debug Window related "First Chance Exception in ...". What is this First
chance
exception??



Tue, 08 Jul 2003 21:04:42 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How to disable a First Chance Exception

2. First-chance exception after deleting CDaoDatabase object

3. Error: First-chance exception in (KERNEL32.DLL) 0x80010108 (no name)

4. Windows CE URLMON.DLL First-chance exception

5. Meaning of message "First Chance Exception"

6. CRecordset and first chance exceptions

7. First-chance exception in xxxxxxxx.exe (KERNEL32.DLL)

8. First-chance exception in Atlhost.h (CAxHostWindow::OnSize())

9. First chance exceptions

10. First Chance Exception

11. First chance exception in ATL server.

12. first chance exceptions?

 

 
Powered by phpBB® Forum Software