What is a First Chance Exception?
来源:互联网 发布:mac装win10无线 编辑:程序博客网 时间:2024/05/22 17:17
David Kline
source:http://blogs.msdn.com/davidklinems/archive/2005/07/12/438061.aspx
What is a First Chance Exception?
Have you ever been debugging an application and seen a message, in the output window, about a "First chance" exception?
Ever wondered:
- What is a first chance exception?
- Does a first chance exception mean there is a problem in my code?
What is a first chance exception?
When an application isbeing debugged, the debugger gets notified whenever an exception isencountered At this point, the application is suspended and thedebugger decides how to handle the exception. The first pass throughthis mechanism is called a "first chance" exception. Depending on thedebugger's configuration, it will either resume the application andpass the exception on or it will leave the application suspended andenter debug mode. If the application handles the exception, itcontinues to run normally.
In Visual Studio, you may see a message in the output window that looks like this:A first chance exception of type 'System.ApplicationException' occurred in myapp.exe
InVisual Studio 2005 Beta2, you will see this message anytime a firstchance exception is encountered in your application's code. If you areusing Visual Studio .NET 2003, this message is shown if you haveconfigured the debugger to stop when the specific exception type isthrown.
If the application does not handle the exception, thedebugger is re-notified. This is known as a "second chance" exception.The debugger again suspends the application and determines how tohandle this exception. Typically, debuggers are configured to stop onsecond chance (unhandled) exceptions and debug mode is entered,allowing you to debug.
Does a first chance exception mean there is a problem in my code?
Firstchance exception messages most often do not mean there is a problem inthe code. For applications / components which handle exceptionsgracefully, first chance exception messages let the developer know thatan exceptional situation was encountered and was handled.
Forcode without exception handling, the debugger will receive a secondchance exception notification and will stop with a unhandled exception.
Take care!
-- DK
Disclaimer(s):
This posting is provided "AS IS" with no warranties, and confers no rights.
Someof the information contained within this post may be in relation tobeta software. Any and all details are subject to change.
PublishedTuesday, July 12, 2005 11:16 AMbyDavidKlineMSFiled under: Debugging
- What is a First Chance Exception
- What is a First Chance Exception?
- What is a First Chance Exception(什么是第一轮异常)
- 关于“First-chance exception”
- first-chance exception
- 关于“First-chance exception”
- First Chance Exception
- vs2010:First-chance exception
- First chance exception 与 Second chance exception
- First chance exception 与 Second chance exception
- First and Second Chance Exception
- First Chance Exception是什么东东?
- First Chance Exception是什么东东?
- 不要放过First-chance exception
- Windows异常分发 - First Chance Exception vs Second Chance Exception
- First-chance exception in xxx.exe...异常
- VC调试程序输出First-chance Exception.
- First-chance exception in Cairo on exit
- 解决安装IE8后,VS2005无法调试的问题
- gcc头文件指定及动态链接的使用
- 朱清时院士警告:创新力别被文化垃圾淹没
- Packet transmission between driver and kernel
- Protocol Handlers
- What is a First Chance Exception?
- 多线程
- COM组件设计与应用(九)IDispatch 接口 for vc6.0
- fzu1015
- aiCache缓存容量管理之路径缓存机制
- 数据库开发文档编写规范
- [转帖]一些不该被埋没的好歌【全版】【2】
- c#(转)
- 参考 2.4.20 2.6.X