Odd CreateWindowEx error

Started by
5 comments, last by UnknownPlayer 21 years, 6 months ago
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.
##UnknownPlayer##
Advertisement
Two window classes in your project may have the same window class name.
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?
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.
##UnknownPlayer##
does registerclass[ex] succeed? how do you know wndproc is never executed?
RegisterClassEx succeeds, and I don''t know that wndproc never executes - I''m actually unsure what goes on during the window creation function.
##UnknownPlayer##
Paste your CreateWindowsEx call here. The most common cause for window creation failure seems to be invalid flags, or other strange parameters.

This topic is closed to new replies.

Advertisement