I am trying to create a new class in the ClassWizard. I just want the base class to be CObject, but that doesn't seem to be an option in the list. Can someone please help?
If you're using the Class Wizard, you can create the class using "generic CWnd" as the base class, then edit the .h file to change the base class reference from CWnd to CObject:
Code:
class MyClass : public CWnd
Also remove the Message Map section from the .h file:
Code:
//{{AFX_MSG(MyClass)
// NOTE - the ClassWizard will add and remove member functions here.
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
Finally, remove the Message Map section from the .cpp file:
Code:
BEGIN_MESSAGE_MAP(MyClass, CWnd)
//{{AFX_MSG_MAP(MyClass)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.