0

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

wlasar86
  • 115
  • 2
  • 9
  • Your code has a bug. You're reading from somewhere that isn't yours to read from. You should be fixing that. Without an [MCVE](http://stackoverflow.com/help/mcve), it's pretty much impossible for us to know where you went wrong. – chris Jul 23 '14 at 19:03
  • The page you linked indicates that the problem is caused by something else running on your computer (AMD/ATI Hydravision in that case) injecting a DLL into your program and not cleaning up properly. Nothing you can do about it other than turning off that functionality in that program. – T.C. Jul 23 '14 at 19:24
  • Thanks for your answers. @ chris: the application I am using is copy pasted from the Microsoft Win32 tutorial I linked in the question into VS and press start with debugging. @ T.C.: indeed I use a AMD Radeon with Hydravision too. So I have to live with these exceptions? – wlasar86 Jul 24 '14 at 20:59
  • A couple posts in the page you linked suggests that you can turn Hydravision off to solve it (I can't test it, I use a Nvidia). – T.C. Aug 03 '14 at 05:47

1 Answers1

0

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.

wlasar86
  • 115
  • 2
  • 9