What am I Doing? class < class > ???
-
Hallo Code Project Members, I`m Using Visual C++ 6 with Prof-Uis. From Prof-Uis tutorials I declared a class like this:
class CMyClass : public CExtNCW < CExtResizableDialog >
It works fine, but I don`t know what I`m doing. Why do I derive CMyClass from 2 classes? What is the difference between
public CExtResizableDialog
and
public CExtNCW < CExtResizableDialog >
Because I don`t know what this kind of Deriving is called, it is difficult to find tutorials about it.. Thank you for your answers!
-
Hallo Code Project Members, I`m Using Visual C++ 6 with Prof-Uis. From Prof-Uis tutorials I declared a class like this:
class CMyClass : public CExtNCW < CExtResizableDialog >
It works fine, but I don`t know what I`m doing. Why do I derive CMyClass from 2 classes? What is the difference between
public CExtResizableDialog
and
public CExtNCW < CExtResizableDialog >
Because I don`t know what this kind of Deriving is called, it is difficult to find tutorials about it.. Thank you for your answers!
CExtNCW
is a template class. Read more about it here - C++ Class Templates[^] There are several template libraries available like ATL, STL etc.«_Superman_» I love work. It gives me something to do between weekends.
Microsoft MVP (Visual C++) -
Hallo Code Project Members, I`m Using Visual C++ 6 with Prof-Uis. From Prof-Uis tutorials I declared a class like this:
class CMyClass : public CExtNCW < CExtResizableDialog >
It works fine, but I don`t know what I`m doing. Why do I derive CMyClass from 2 classes? What is the difference between
public CExtResizableDialog
and
public CExtNCW < CExtResizableDialog >
Because I don`t know what this kind of Deriving is called, it is difficult to find tutorials about it.. Thank you for your answers!
CExtNCW is a template class and CExtResizableDialog is the template parameter. You are only inheriting from one class (the CExtNCW class) but as this class is a template class, you have to specify it's template parameter. I suggest you google for templates in C++ because you first need to understand how it works before being able to understand what the code means.
Cédric Moonen Software developer
Charting control [v2.0] OpenGL game tutorial in C++