Search code examples
c++exceptionwndproc

first chance exception in standard win32 wndproc


I am learning DirectX with C++. As example for standard Win32 programming basics I referenced the Microsoft Developer Network - Creating Win32 Applications (C++).

The example shows how to setup a single window and set the WndProc. When closing the application I get up to 6 error messages:

"Exception (first chance) at xy in myapp.exe: access violation reading location yz"

With the help of Mr. Google I found this (DestroyWindow(HWND) gives me exceptions) question in social.msdn. It is nearly what I was searching for, but I do not understand it completely.

  1. Why the exceptions (first chance) are thrown when closing the application?
  2. Is there no way to prevent the application of throwing these exceptions (not only switch off these exceptions in VS, instead defeat them)?
  3. When ignoring these exceptions, will they cause a crash of my application in the future?

I hope you get what I am trying to say and someone can help me and explain it clearly for me.

Many thanks in advance.

Greetings


Solution

  • Updating graphics driver and uninstalling Hydravision works to remove the exceptions. However, after clean reinstall of complete system there isn't any error at all.