Click to See Complete Forum and Search --> : CDialog inheritance


Quakey
September 26th, 1999, 06:29 PM
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.

ChrisD
September 26th, 1999, 08:53 PM
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