开发者

Why ATL calls subclassing "superclassing"

Getting interested in learning ATL, I started reading this tutorial and I got confused at reading this (also related):

If you want开发者_运维技巧 to extend the capabilities of a predefined window class, such as the button or list box controls, you can superclass it.

Why is it called super-classing instead of sub-classing?


Super-classing is writing a new class, that would behave as it it was a new control altogether. A CColoredButton inheriting from CButton would be superclass, when you create instance of CColoredButton

When you already have a control (probably on resource), you may subclass it. Here the "control" in picture is being handled differently and hence the term subclass.

Any class may behave as super class or subclass. You would call some of SubclassXX function/method to subclass already existing control. You would create instance of a control at runtime by allocating the C++ object (CColoredButton) by calling its Create method - here the term super-class.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜