I created a class. Here it is, pretty simple and easy-to-understand:
#if !defined(AFX_NODE_H__C69D4DE3_E295_11D5_8A89_444553540000__INCLUDED_)
#define AFX_NODE_H__C69D4DE3_E295_11D5_8A89_444553540000__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CNode : public CObArray
{
private:
CNode *pChild;
CNode *pParent;
int ObjectID;
public:
CNode() : pChild(NULL), pParent(NULL) {}
void Attach(CNode *pChild);
void AttachTo(CNode *pParent);
// Internal add node/remove node for this object
void AddNode (CNode *newNode);
bool RemoveNode (CNode *remNode);
void RemoveNode (int ObjectId);
int GetNodeIndex (int ObjectId);
CNode *FindNode (int ObjectId);
virtual ~CNode();
};
#endif // !defined(AFX_NODE_H__C69D4DE3_E295_11D5_8A89_444553540000__INCLUDED_)
What it gives me is an error saying that CObArray is undefined base class.
error C2504: ''CObArray'' : base class undefined
I tried to include afxcoll.h, but it gives me error that _WINDOWS_ is already included.
fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include
How do I use that CObArray class to declare class CNode : public CObArray ?
Thanks.