|
-
April 7th, 1999, 10:54 AM
#1
Adding class to the class wizard
I have a class that I add the .cpp and .h files to my project. I want to derrive a new class from that class using the class wizard. How can i get that class to show as a base class in the class wizard on the add new class dialog?
Thanks,
Steve
Steven M. McNeese
[email protected]
-
April 7th, 1999, 11:15 AM
#2
Re: Adding class to the class wizard
You cant. You simply choose "Generic class" and manually add the #include directive for the header file in the newly created class' header file.
Mind you that this is also the procedure if you want your class to derive from CObject, because CObject is not listed in the combobox - just as a lot of other MFC classes.
-
April 7th, 1999, 11:36 AM
#3
Re: Adding class to the class wizard
I did that, but now I am getting link errors. I modified the .h file of the newly created class and changed the class CNewClass : public CWnd to class CNewClass : public COldClass. I also added the header file for the oldclass to the header file of the new class. What am I missing?
Steven M. McNeese
[email protected]
-
April 7th, 1999, 01:48 PM
#4
Re: Adding class to the class wizard
You're using VC6, aren't you? I've noticed this strange new behavior too. When you add a CPP and H file to a project, and do a build, it (of course) compiles the new CPP and H file, but won't link. It's as if the compiler created the OBJ file, but the linked doesn't know to add it in yet. Very strange.
But the fix is easy. Instead of doing an "F7" build, do a "Ctrl-F7" compile of the new CPP file. Then do a normal "F7" build. You only have to do that once per new CPP file, and I have no idea why it is necessary.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|