need Windows/C++ gurus help
I am writing a new windows class for a new game I am going to work on.
I have a dialogue box to ask the user what resolution to run in. The problem is I have been unsure of my design. I have globals in the file WinMain when I dont want to really use them ,I have tried fiddling around i.e making member functions static(so defeating the object ). Could you please look at my code and suggest on a better implementation for this part of the class. Ps I am quite new to making more complex windows applications.
my code can be downloaded from
http://members.lycos.co.uk/knealeaj/files/
Thanks
Use a toolkit.
SDL
wxWidgets
Qt
- Magmai Kai Holmlor
Not For Rent
[Look for information | GDNet Start Here | GDNet Search Tool | GDNet FAQ | MSDN RTF[L] | SGI STL Docs | STFW | Asking Smart Questions ]
[Free C++ Libraries | Boost | ACE | Loki | MTL | Blitz++ | wxWindows| Spirit(xBNF)]
[Free C Libraries | zlib ]
SDL
wxWidgets
Qt
- Magmai Kai Holmlor
Not For Rent
[Look for information | GDNet Start Here | GDNet Search Tool | GDNet FAQ | MSDN RTF[L] | SGI STL Docs | STFW | Asking Smart Questions ]
[Free C++ Libraries | Boost | ACE | Loki | MTL | Blitz++ | wxWindows| Spirit(xBNF)]
[Free C Libraries | zlib ]
Thanks for the reply .But I want to finish this class as it is nearly complete. And I like to know the solution for my own interest
Well the first thing that I noticed about your code is that the wrap of the windows class is incomplete. You create the window with the class funtion and then you use a non-class window procedure... the way I reccomend that you do it is to make the wnd proc a static member of the class and have it route messages to each of the class''s instances. You can retrieve the message''s window by using the function GetWindowLong() with GWL_USERDATA.
I believe that there is a tutorial here about writing a windows message wrapper... found it. I hope this will be helpfull:
http://www.gamedev.net/reference/articles/article1810.asp
I believe that there is a tutorial here about writing a windows message wrapper... found it. I hope this will be helpfull:
http://www.gamedev.net/reference/articles/article1810.asp
As far as the Dlg Proc is concerned... if you only use the Dlg once then leaving it where it is now is fine. If you plan to use it more than once or if you are going to include it into another file... then you will probably want to write a class with a similar static member as the window.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement