Mysterious crash on DestroyWindow()

This is a discussion on Mysterious crash on DestroyWindow() within the Game Programming forums, part of the General Programming Boards category; Hey everyone, I have a problem (yes, I always do ). This is my code:
Code:
void gameShutdown()
{
ShowCursor(TRUE);
...

If I take out the DestroyWindow(), it will quit normally. If I leave it in, it will give me an illegal operation ("invalid page fault"). DestroyWindow() is not called anywhere else in the program; and also, the same code minus the ShowCursor() worked fine in another project. Does anybody have an idea of what's wrong?

Weeeiiird! It just mysteriously quit normally... Maybe some of the code didn't quite get re-built earlier or something. Oh well, thanks for the help anyways, silvercord!

I know I've had similar problems, but I could not remember what they were and I didn't want to keep giving suggestions because I didn't remember, sorry I couldn't actually solve the problem when you had it, and i hope your problem stays out for good.