Archived

This topic is now archived and is closed to further replies.

Odd CreateWindowEx error

This topic is 5536 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a function in my application which initializes the main application window. Recently though, it seems to have broken, and I''ve tracked the problem to my CreateWindowEx function call. The thing is though, I can''t for the life of me tell why its failing, or returning the error message that it does. When I call GetLastError() on it, it returns error code 183 - which is the ''already exists'' error. This is even after a clean start of the system and the first execution of the program. I was wondering if anyone might be able to enlighten me as to what can cause CreateWindowEx to return this. Any help is appreciated.

Share this post


Link to post
Share on other sites
quote:
Original post by David ONeil
Two window classes in your project may have the same window class name.

this shouldn''t be a problem. i''d look for oddities in wndproc instead. for instance, are you returning defwindowproc() when appropriate?

Share this post


Link to post
Share on other sites
Well the thing is my program never gets to WndProc (though I must admit I''m somewhat sketchy on the way it works i.e. where it gets called and such). It returns this error when trying to create a new window for the first time in the program. I know its not another window class, because I only have 1 and its a singleton.

Share this post


Link to post
Share on other sites
Paste your CreateWindowsEx call here. The most common cause for window creation failure seems to be invalid flags, or other strange parameters.

Share this post


Link to post
Share on other sites