classwizard and making a derived class a base class for another class

classwizard and making a derived class a base class for another class

Post by Randy Shave » Fri, 21 Feb 1997 04:00:00



I am new to Visual C++ and have been trying to get ClassWizard to do
something automatically for me and have not been able to figure this
out.

I am using Visual C++ 4.0 Standard Edition.

What I want to do:

The first class that I add is CDrawWnd:: public CWnd{}.
I now want to add another class CNewWnd::public CDrawWnd{}.
I have tried adding a new class and looking for the CDrawWnd in the base
classes available and this does not work.  I am putting each class in a
file of their own.  Can anyone give me a hint if Class Wizard will do
this for me, or do I have to go in and do all the coding myself?  Is
there a way for ClassWizard to recognize a derived class for use as a
base class is the just of the question.

Thanks,
Randy

 
 
 

classwizard and making a derived class a base class for another class

Post by Ashley W. Bo » Fri, 21 Feb 1997 04:00:00


Quote:>The first class that I add is CDrawWnd:: public CWnd{}.
>I now want to add another class CNewWnd::public CDrawWnd{}.
>I have tried adding a new class and looking for the CDrawWnd in the base
>classes available and this does not work.  I am putting each class in a
>file of their own.  Can anyone give me a hint if Class Wizard will do
>this for me, or do I have to go in and do all the coding myself?  Is
>there a way for ClassWizard to recognize a derived class for use as a
>base class is the just of the question.

You can't add choices to the base class list in the 'Add new class'
option in classwizard - you're stuck with what it gives you.  The
easiest thing to do is to use classwizard anyway, choosing CWnd
as your base class, then going to the new source files and replacing
every occurrence of CWnd to your class, CDrawWnd.  Make sure
to change all of them, including the occurrences in the MFC macros.
Then add your header file for CDrawWnd, add any necessary stuff
to the constructor, etc.

After doing that, you should be able to map messages to your new
class normally using classwizard.

ashley

 
 
 

classwizard and making a derived class a base class for another class

Post by Arkady Elterma » Fri, 21 Feb 1997 04:00:00


ClassWizard can't offer you your own class as a base class.

However, you don't have to "do all the coding yourself".
Accept CWnd as a base class from ClassWizard, and then go and replace
instances of CWnd with CDrawWnd.

Arkady Elterman.

 
 
 

1. Derive a class from CRecordset class and have the derived class appear in Classwizard Dropdown

Hi,
I want to do the following:

Derive a class from CRecordset that extends the functionality of CRecordset
BUT does
not yet reference any specific recordset. (an abstract class I guess).
I want this derived class to appear in the "base class" dropdown of the MFC
Class Wizard "Automation" tab
when I select "new Class".

The problem is I can only use class wizard to create new derived class from
CRecordset when I actually
want to create a new derived class specialised for a certain recordset from
my new baseclass.
Is this possible?
At present I select CRecordset and manually edit the resulting CRecordset
derived class.
Visual Studio enterprise V6.0SP3

Cheers,
Andy Cullen

2. explorer in xp

3. Use class wizard to derive a new class from a present class?

4. Cant send email with OE 6 after getting new Norton anti-virus

5. Creating a class through class wiz which derives from a class not listed

6. winCE webserver - access permissions

7. How to: CCmdTarget derived class inside another CCmdTarget derived class.

8. Compaq TC1000 Wireless WEP Key

9. using a derived class of a CView derived class

10. : Adding an MFC-derived base class to ClassWizard

11. Template class derived from a Template class???

12. MFC Derived Classes from Classes

13. Deriving a C++ class from an imported C++ DLL class?