HOWTO: Derive From Classes not Listed in ClassWizardLast reviewed: November 26, 1997Article ID: Q99161 |
The information in this article applies to:
The ClassWizard included with: - Microsoft Visual C++ for Windows, version 1.0, 1.5, 1.51, and 1.52 - Microsoft Visual C++ 32-bit Edition, version 1.0, 2.0, 2.1, 2.2, 4.0, 4.1, 4.2
SUMMARYMicrosoft ClassWizard supports deriving classes only from the classes listed in the Class Type field of the Add Class dialog box. To create a class derived from a previously derived class or to derive from another class based on the Microsoft Foundation Class Library CWnd class that is not listed in the Class Type field, a few extra steps are required. The text below presents these steps.
MORE INFORMATIONFor example, suppose the following derivation tree is desired:
MyDerivedClass ^ | MyBaseClass ^ | CDialogor, it is desirable to derive a class from a class based on CWnd that is not listed in the Class Type field in the Add Class dialog box, such as CFileDialog. There is no predefined method to create this type of class hierarchy using the ClassWizard. However, by using the parsing techniques ClassWizard uses, you can create these class hierarchies. The steps below use CDialog as the default class type. Before proceeding, determine which predefined class type is closest to the desired base class. For example, CFileDialog is similar to CDialog. If none of the classes correspond closely to your desired class, use the generic CWnd class. To create a class with multiple levels of derivation, perform the following three steps:
For classes created using multiple levels of derivation, you can use ClassWizard to pass system messages, such as WM_INITDIALOG, to the base class as well. To do this, perform the following nine steps:
Keywords : WizardIss Version : WINDOWS: 1.0, 1.5, 1.51, 1.52;; WINNT: 1.0, 2.0, Platform : NT WINDOWS Issue type : kbhowto |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |