D3D ate my window handle!

Started by
2 comments, last by IndyJones 18 years, 11 months ago
Okay, I'm getting a strange problem here. I am initializing D3D, rendering away all hapilly, and I'm closing down D3D when I quit (which is apparently happening smoothly). Now, after everything is closed the final thing I am doing is calling DestroyWindow on my HWND. On this call I get a big uh oh :(. As I step over the call, I get a MessageBeep sound (systemstop), and the prcoess is immedatly terminated (DestroyWindow never returns). This ONLY happens if I've used D3D during the life time of the app. I have tried enabling the D3D debug runtimes to see if it's telling me anything. But it's not telling me anything out of the ordinary. Anyone have any clues what may be happening here? These kind of bugs annoy the crap out of me >_<. The only work around I have at the moment is to not call DestroyWindow at all, but that is peh. Thanks.

- Thomas Cowellwebsite | journal | engine video

Advertisement
In all my time windows programming, I've never used DestroyWindow. I don't mean to leach from your thread, but why is it needed? I've read about what it does, but wouldn't returning from WinMain() cause these things to happen as well?

Are you using MFC::DestroyWindow()? Or just the standard version? Also, are you using DirectInput or other window-specific APIs or routines?
Okay. After much angst, I have worked out what was happening. It, in fact, had nothing to do with D3D at all (that was just a side effect of only having the window shown when D3D was initialized).

I was calling a funtion from within WM_ACTIVATE, and in that function it was asserting. Fair enough. But why..._WHY_ didn't it come up with an assert dialog? It just hit the assert, failed the test, beeped, and then terminated without any message. That's just making assert's counter productive.

Anything I could have done to disable asserts?

[edit]
Well, I just realized that I can't have "disabled" assert dialogs, since I do remember popping up an assert earlier today. How can some assert's work properly, and some not?

- Thomas Cowellwebsite | journal | engine video

If you use VS.Net 2003 you can "disable/enable" the "assert dialogs" caused by unhandled exceptions in the IDE.
If you go to Debug/Exceptions in the menu you can change the behaviour of the Debugger when a certain exception occurs. You can either "break into the debugger" or "continue" with the execution (you will only see that an exception occured in the Debug Output Window then).

Maybe the type of exception that occurs in your app has the "continue" option set ...

Hope that helps!

This topic is closed to new replies.

Advertisement