Menu

Why we need additional Control classes for control varibles

Help
Erik Don
2021-01-16
2021-01-16
  • Erik Don

    Erik Don - 2021-01-16

    This code confused me a lot. while we need a control varible why we make a control class first, and these classes change nothing. From my previous knowledge we can just use original class for control varible declarition. Or I have made mistakes in former?

          // nested classes for some of this dialog's child windows
          // that require no changes from the base class
          // (nesting is optional--it's done here to keep the IDE's
          // class view tidy)
        class CMyComboBox      : public CComboBox      {};
        class CMyListBox       : public CListBox       {};
        class CMyProgressBar   : public CProgressBar   {};
        class CMyRichEdit      : public CRichEdit      {};
        class CMySlider        : public CSlider        {};
        class CMyMonthCalendar : public CMonthCalendar {};
        class CMyDateTime      : public CDateTime      {};
    
     
  • David

    David - 2021-01-16

    Hi Erik,

    Yes we can just use the original class for the member variable. Typically though its it preferable to override the original class so it can be easily modified when we develop our own dialogs. The code here provides the overridden classes as a starting point for future modifications.

    Best regards,
    David Nash

     
    • Erik Don

      Erik Don - 2021-01-16

      Thank you David, I will try to find the scenario.

       

Log in to post a comment.