Create or derive a cwnd-based class in MFC

Source: Internet
Author: User

 The text written earlier is a little simple. Here I will explain the problem in detail:

 

In the VC ++ environment, you can use the classwizard Wizard to create your own classes from the MFC class. For example, we can derive a subclass of ctreectrl to implement our own tree control. However, not every class of MFC can be found in classwizard, such as csplitterwnd class. You can manually write your own classes from such a class according to the C ++ syntax rules.CodeIn this way, classwizard cannot be easily used to add messages of the class and overwrite the virtual function. So here is another method:In the newclass dialog box, select MFC class in classtype and generic cwnd in base class for derivation,Then manually change the base class of the newly added class to the required cwnd subclass, for example:
First, it is derived as follows: Class cusefulsplitterwnd: Public cwnd
Then manually change it to: Class cusefulsplitterwnd: Public csplitterwnd

Of course, there may be more than one place to manually modify. Other MFC classes can also be processed as follows :)

 

Source:Http://aip.javaeye.com/blog/98952Thanks for sharing AIP.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.