15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


multiple levels of derivation using ClassWizard

Uma Shankar -- Uma_Shankar@countrywide.com
Tuesday, May 21, 1996

Env: VC++ 4.1 , NT 3.51
hi all,
I got a class QParentWnd which is derived from  CWnd.  I got to derive
two more classes  from QParentWnd.  Is it possible to derive from this
class using classwizard?  What are the steps needed to ensure that
'QParentWnd' appears in the base class field of 'Create New Class'
Dialog?

www.microsoft.com/kb/faq/devtools/vc/mfc/faq1684.html talks about this
question, but it is not mentioning the steps needed to do multile
levels of derivation.

Thanks 

Shanky




David W. Gillett -- DGILLETT@expertedge.com
Tuesday, May 28, 1996

On 21 May 96 at 16:44, Uma Shankar wrote:

> Env: VC++ 4.1 , NT 3.51

  Thanks.

> I got a class QParentWnd which is derived from  CWnd.  I got to
> derive two more classes  from QParentWnd.  Is it possible to derive
> from this class using classwizard?  What are the steps needed to
> ensure that 'QParentWnd' appears in the base class field of 'Create
> New Class' Dialog?
> 
> www.microsoft.com/kb/faq/devtools/vc/mfc/faq1684.html talks about
> this question, but it is not mentioning the steps needed to do
> multile levels of derivation.

  Although ClassWizard helped you derive QParentWnd from CWnd, this 
does not add QParentWnd to ClassWizard's "database of clsses I know 
how to derive from".  So ClassWizard can be of only limited help in 
deriving classes from QParentWnd.
  But every class derived from QParentWnd is also derived from CWnd, 
which ClassWizard *does* know about.  So you can use ClassWizard to 
define new derivatives from CWnd, and then edit the .H and .CPP files 
to reflect inheritance from QParentWnd instead.
  I believe there are actually only 4 places where you may need to change 
the name of the base class:

1.  At the top of the class declaration in the .H file.

2.  In the IMPLEMENT_DYNCREATE macro at the top of the .CPP file, if 
present.  [If not present, there may be some other macro here you 
need to change.]

3.  In the BEGIN_MESSAGE_MAP macro, near the top of the .CPP file.

4.  In the header of the class constructor, which *may* pass 
parameters to the base class constructor.


  ClassWizard won't help you instantiate/override in your derived 
classes methods you introduce in QParentWnd -- you'll have to do that 
by hand.

Dave





| Вернуться в корень Архива |