Why does ATL call the superclass subclass

Interested in learning ATL, I started reading this tutorial , and I was embarrassed at reading this (also related) :

If you want to extend the capabilities of a predefined window class, such as button or list controls, you can overclass it.

Why is this called superclassing instead of a subclass?

+4
source share
1 answer

Super-classing is writing a new class that will act as if it were a new control. CColoredButton inheriting from CButton will be a superclass when you instantiate CColoredButton

When you already have a control (possibly on a resource), you can subclass it. Here, the “control” in the image is handled differently, and therefore the term “subclass”.

Any class can behave as a superclass or subclass. You would call the SubclassXX part of the function / method to subclass an existing control. You must create an instance of the control at run time by highlighting the C ++ object ( CColoredButton ) by calling its Create method - here is the term superclass.

+2
source

All Articles