Archived

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

gdClash

Basic window creation wrapper problems

Recommended Posts

I''m trying to write a class that wraps the humm drumm windows creation\register class crap, and I want to have a default window procedure in the class. So I declared it as static LRESULT CALLBACK ... and in my WNDCLASSEX structure I set the lpszWndProc to be zCWin::WndProc, thats the name of the class\function. The problem is that it''ll compile but it doesnt register the window class when its running. Any ideas? And when I finish this, I''ll post it if you guys want me to. It''s very simple, but it is all that necessary in my opinion, for a Dx app. Did I mention that NeXe rules? hehe. - Clash - www.zeroinfinity.net - A New World, Built By New Minds

Share this post


Link to post
Share on other sites
Post your setup of the WNDCLASS/WNDCLASSEX as well as your RegisterClass/RegisterClassEx call and it''ll help us find the problem.

Share this post


Link to post
Share on other sites
Interestingly enough I was able to get the class to register. I had filled out one of the WNDCLASSEX parameters incorrectly. But it still doesn''t work! I think the problem is that DispatchMessage() can''t handle a static window proc. What do you guys think?

- Clash
- www.zeroinfinity.net
- A New World, Built By New Minds

Share this post


Link to post
Share on other sites
Nope I didn''t track it down but here''s what I did. I tried it with the static WndProc and my window didnt receive any messages. I tested it, I put a Messagebox in one of the events and it never got called. Then I took the WndProc out of the class and I got message boxed to hell. So the only thing I changed was take it out of the zCWin::WndProc and move it to ::WndProc. I think that the problem is that Windows doesnt know howto call the wndproc if its not in the global(default) namespace. Perhaps there is some way around this?

Thanks for all the help!

- Clash
- www.zeroinfinity.net
- A New World, Built By New Minds

Share this post


Link to post
Share on other sites