Jump to content
  • Advertisement
Sign in to follow this  
derek7

subclassing

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

subclasing is just replacing a window proc with another,isn't it? there are some subclassing way: 1.derived a win class (class myButton :CButton) in mfc. 2.use SubclassWindow() 3.directly use SetWindowLong() any other way?

Share this post


Link to post
Share on other sites
Advertisement
Yes, subclassing is just replacing the window proc. It's a little like using virtual functions. When you subclass a window, you only handle a few messages (usually), and then you just call the base window's window proc (Using CallWindowProc(), never call it directly or Bad Things will happen).

The only real way to do it is with SetWindowLong(). MFC provides SubclassWindow() which just wraps that behaviour. If you're using MFC, by all means use SubclassWindow().

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!