今晚写程序没多久,程序也没任何报错和warning,但运行后图像窗户马上消失,无法显示,调程序浪费了一个多小时,遇到千奇百怪的问题,彻底抓狂,最后在程序没修改的情况下换上我笔记本运行,经完全没错!
调试的时候报的问题一个是First chance exception,有时还会莫名出现R6025-pure virtual function call,不稳定~
对于第二个问题,即R6025,一般认为是窗口没销毁造成的,但我用的是C++版本,不用手工销毁窗口,他居然报错~不理解
对于第一个问题,查了些资料,有认为是kernel32.dll的问题,下面摘下了比较专业的解释,对于这两个问题我最终的解决方法是:重启!然后完全没错!如果你遇到第二个错误而且用的是cvNamedWindow,就要检查下是不是没有Destroy。
----------------------------------------------------------------------------
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?
When an application is being debugged, the debugger gets notified whenever an exception is encountered At this point, the application is suspended and the debugger decides how to handle the exception. The first pass through this mechanism is called a "first chance" exception. Depending on the debugger's configuration, it will either resume the application and pass the exception on or it will leave the application suspended and enter debug mode. If the application handles the exception, it continues 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
In Visual Studio 2005 Beta2, you will see this message anytime a first chance exception is encountered in your application's code. If you are using Visual Studio .NET 2003, this message is shown if you have configured the debugger to stop when the specific exception type is thrown.
If the application does not handle the exception, the debugger is re-notified. This is known as a "second chance" exception. The debugger again suspends the application and determines how to handle this exception. Typically, debuggers are configured to stop on second 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?
First chance exception messages most often do not mean there is a problem in the code. For applications / components which handle exceptions gracefully, first chance exception messages let the developer know that an exceptional situation was encountered and was handled.
For code without exception handling, the debugger will receive a second chance exception notification and will stop with a unhandled exception.