grahamfletcher
Programmer
I know there's some C++ geniuses out there - hopefully somebody can solve this problem I've encountered. I'm fairly new to C++ (though I've been using C for years), so go easy on me 
I want a class (which I'm going to use in a CList), which can contain lists of its own type. For example:
class CTreeEntry
{
CString Name;
CString Description;
CList <CTreeEntry, CTreeEntry&> ChildTrees;
}
But I can't get it to work. In C, I'd just use a list-styled struct with a pointer to the struct type as a member, and form a list from that.
Am I right in thinking I should be using a CTypedPtrList, or are there other ways to get what I'm trying to achieve?
I want a class (which I'm going to use in a CList), which can contain lists of its own type. For example:
class CTreeEntry
{
CString Name;
CString Description;
CList <CTreeEntry, CTreeEntry&> ChildTrees;
}
But I can't get it to work. In C, I'd just use a list-styled struct with a pointer to the struct type as a member, and form a list from that.
Am I right in thinking I should be using a CTypedPtrList, or are there other ways to get what I'm trying to achieve?