CObject or CStatic
-
Hi I'm a VC beginner.I'm trying to insert a new class into my project and i wanted to set the base class of the new class as CObject but the option is not available in the combo box. Why is that so? And i noticed that CStatic is frequently chosen as the base class of new classes. Why is that so? I've read up on the MSDN help file but i'm still very confused abt the features of CStatic class. thks thks n Happy New Year!:-D
-
Hi I'm a VC beginner.I'm trying to insert a new class into my project and i wanted to set the base class of the new class as CObject but the option is not available in the combo box. Why is that so? And i noticed that CStatic is frequently chosen as the base class of new classes. Why is that so? I've read up on the MSDN help file but i'm still very confused abt the features of CStatic class. thks thks n Happy New Year!:-D
In VC6 (Don't know how's in VS.NET) you choose the class type as the first parameter in the New Class dialog. The default value is MFC Class - it supports deriving your class from one of the offered MFC classes (with some extended function - message map and DDX macros for dialogs and windows are generated etc.). If you need to derive your class from other class, use Generic class type. You can enter any parent class name. And of course you can create your class manually as the only "bonus" in this mode is, that the cpp and header files are created and added to the project. You only need to derive from CObject, if you want to use MFC functionality like Serialization or some MFC collections with your class. CStatic is label control for dialogs, derive your class from it only if you want to extend it's functionality. Pavel Sonork 100.15206
-
In VC6 (Don't know how's in VS.NET) you choose the class type as the first parameter in the New Class dialog. The default value is MFC Class - it supports deriving your class from one of the offered MFC classes (with some extended function - message map and DDX macros for dialogs and windows are generated etc.). If you need to derive your class from other class, use Generic class type. You can enter any parent class name. And of course you can create your class manually as the only "bonus" in this mode is, that the cpp and header files are created and added to the project. You only need to derive from CObject, if you want to use MFC functionality like Serialization or some MFC collections with your class. CStatic is label control for dialogs, derive your class from it only if you want to extend it's functionality. Pavel Sonork 100.15206