Jump to content
  • Advertisement

Archived

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

Challenger17

Problem with windows message handler...

This topic is 5282 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

ok here''s the problem. i wrote a class of my own named "CEngine". it has a static member function "static LRESULT WINAPI MsgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam )" which is used as the message handler for my app''s main window. ok, now this window has a menu, and i want to change some Render State parameters through this menu when the app is running. the problem is, MsgProc() must be declared as a static member in my class, and those Render State parameters are also part of my class, they can''t be accessed by MsgProc() coz it''s static!!! so, how can i change some Render State parameters through window menu? btw i don''t want MsgProc() to be separated from my class. thx!

Share this post


Link to post
Share on other sites
Advertisement
The usual solution to this problem is to use SetWindowLong() and GetWindowLong() with GWL_USERDATA to store a pointer to the object that can be used to access member variables. An example of how you might do this is in Oluseyi''s article on window wrappers here on gamedev.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!