Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. CObject or CStatic

CObject or CStatic

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestionlearning
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    raner
    wrote on last edited by
    #1

    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

    P 1 Reply Last reply
    0
    • R raner

      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

      P Offline
      P Offline
      Pavel Klocek
      wrote on last edited by
      #2

      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

      R 1 Reply Last reply
      0
      • P Pavel Klocek

        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

        R Offline
        R Offline
        raner
        wrote on last edited by
        #3

        i see..so i just choose Generic Format and type in CObject myself? ya..i've read that CStatic is for static label which is why i'm surprised so many complicatd classes in the sample programs are derived from them! Thks alot!

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups