Skip to main content
GameDev.net gamedev.net
🔒 Locked

CreateWindowEx

Started by Tooko Mar 17, 2005 at 4:53 AM 3 replies 850+ views
Original Post
Tooko
Tooko
Okay, for some reason everytime I go to create a window, it crashes. Any code I've written up to a week ago works, but any new projects don't. So, I created a totally new project (win32 project) and copied the DirectX tutorial code to create a window. Lo and behold, it crashed. So I uninstalled MSVC completely, and reinstalled. Same problem. I ran it through a debugger, and it registers the class and everything fine, but when it calls CreateWindowEx it returns 0xC0000007... which is an access violation. In the assembler window, this seems to be happening even before the program enters. This sucks. As soon as I find motivation to write something...
the future is just like the past, just later. - TANSTAAFL
dave
dave
Hi mate,

Post up the entire code. Put it inside
flags and ill have a look.

ace
furiousuk
furiousuk
I had something similar and slapped myself in the face when I realised I'd forgotten to link my project to the appropriate libraries. This shouldnt cause an access violation tho so probs isnt your problem.
Evil Steve
Evil Steve
What is the exact error? The access violation should give something like "Access violation reading address 0x00000000".
I suspect that there's something dodgey in your window message procedure, probably accessing a pointer that hasn't been set yet. Remember that you get 3 or 4 messages sent to your message procedure before CreateWindowEx() returns.
Tooko
Tooko
I'd post the exact code, but I it's not on this computer and um... certain restrictions mean I can't copy it over.
Anyway, I'm using the default MsgProc. I don't usually do that for a game or anything, but if I'm just writing a test program I usually do... and it's always worked for me.

It's just wierd how on all the programs I've written to a few days ago, work. Even if I copy the exact code (linked libraries, dlls etc) it still doesn't work. I even copied one of the tutorial programs that come with DX9, deleted the project files but kept the code and it wouldn't compile after I created a blank project and added the required files.

EDIT: Hmm... accidentally wrote "prograsm".
the future is just like the past, just later. - TANSTAAFL

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.