Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create a new class based on CObject with the ClassWizard 1

Status
Not open for further replies.

cmitzel

Programmer
Mar 8, 2002
7
0
0
US
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. [sad] Can someone please help?

Thanx,
Chris [3eyes]
 
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()
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top