Creating a new class

I want to make a new class that I can have other classes inherit from. When I run class wizard, it wants me to assign a dialog to the new class. I don't want it to be assigned to a dialog, but a warning comes up saying if I don't assign it one, there will be an error. How do I get around this? Thanks for any help.

By the way, when I tried to compile it, it gave me the error
'UNKNOWN_RESOURCE_ID_': undeclared identifier
and
expected constant expression

Hope this gives more insight into the problem.
[557 byte] By [IsThisOneTaken] at [2007-11-19 9:17:26]
# 1 Re: Creating a new class
In the .NET IDE you do that using the menu command Project / Add Class. You're then presented with a whole bunch of templates to base the new class on. It's also possible to just add a new item to the project and type in the stuff yourself, but that's getting old-fashioned.

Jay
Jay Tautges at 2007-11-11 0:20:58 >
# 2 Re: Creating a new class
When you create a class using the class wizard, you have the option to create a generic class.
standby1 at 2007-11-11 0:21:49 >
# 3 Re: Creating a new class
Hi,
The following tool maybe useful to you:
http://www.ucancode.net/Products/free%20product/codewizard.htm

Jack
------------------------
XD++ MFC/C++ Flow/Diagram Library -- http://www.ucancode.net
andytim at 2007-11-11 0:22:58 >
# 4 Re: Creating a new class
Ok, I tried the adding a class through the insert menu and it worked. My problem is that I have a form in my program. I want it to inherit from my custom made class, which inherits from CFormView. I don't think I can have my custom class inherit from CFormView however because then it needs to have a dialog resource. So instead I made it inherit from CView. Now, when I make my dialog class in class wizard, when it asks for a base class, my custom made class isn't in the list. So, I just made it inherit from CFormView, and went and changed all the places where it wa sin the code to my custom class. Now I'm getting all kinds of errors!

If someone knows how to make a form class inherit from a custom made class in visual c++ 6.0, can you please inlighten me?

To bemore specific:
My program has 6 toolbar buttons. Each button is associated with a different form. I want each form to have it's own class. However, I want all those classes to inherit from one central class. If anyone knows how to do that, could you please help me out, thanks.
IsThisOneTaken at 2007-11-11 0:23:55 >
# 5 Re: Creating a new class
Ok guys, I still need some help on this. I have 6 forms that I want loaded when the toolbar or menu item is selected. I can make each form load fine. My problem is that I want to have a central class which each of the form classes can inherit from and that one main class inherits from CFormView. However, inheriting from CFormView requires a dialog resource or it gives me errors. Should I make the base class simply CView? Also, how can I add a class with that as the base class without using class wizard in visual C++ 6.0 not the .NET version? Any help would be greatly appreciated.
IsThisOneTaken at 2007-11-11 0:24:54 >
# 6 Re: Creating a new class
However, inheriting from CFormView requires a dialog resource or it gives me errors. Should I make the base class simply CView?
If you want a common base class, derived from CFormView, you can do that. Make it's constructor take the template ID as an arg, and all six classes derived from it will pass their own unique ID.

Also, how can I add a class with that as the base class without using class wizard in visual C++ 6.0 not the .NET version?I can't help you there, I'm using VS.NET. I'd guess theres a way to create a generic class and you would type in your own base class name. If not, create your own template file.

Jay
Jay Tautges at 2007-11-11 0:25:56 >
# 7 Re: Creating a new class
I can't help you there, I'm using VS.NET. I'd guess theres a way to create a generic class and you would type in your own base class name. If not, create your own template file.
Jay
Can you explain to me what a template file is? Thanks for the help.
IsThisOneTaken at 2007-11-11 0:26:57 >
# 8 Re: Creating a new class
By template file I meant make your own set of .cpp/.h files holding the definition of a class. They can look the same as the result of the Wizard's output, or you can add more if you want.

Remember I said previously that to do that is old-fashioned. Today the IDE is fancy and we just point-n-click.

Jay
Jay Tautges at 2007-11-11 0:28:01 >