CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 1999
    Posts
    117

    CDialog inheritance

    Hi there,
    I'd like to create a base dialog class that has speific background color and other apperance attributes, and so all other dialog can inherit that base class and therefore inherit all the apperance uniqueness. But how do I do that? I already created a CDialogBase which is derived from CDialog, and I overloaded its ON_CTLCOLOR, then what i do? Just create another CDialog-based but change its base to CDialogBase from CDialog? If i do that, the constructor calls are different and that causes problem(CDialog(id,hwnd), but CDialogBase(hwnd)). Thanks.


  2. #2
    Join Date
    May 1999
    Posts
    667

    Re: CDialog inheritance

    What you described is correct, just change you base class constructor to be the same as CDialog, and stop passing the IDD_BASEDIALOG to the CDialog construtor, pass in the id passed from the derived class instead.

    HTH,
    Chris


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured