Apologies, minor error in the code. Problem still outstanding.
class A
{
A() {}
void AddChild(A* child)
{
m_aryChildren.Add(child);
}
CArray<A*> m_aryChildren;
}
class B : public A
{
B()
{
A::AddChild(new A());
}
}
// ....
A aobject;
aobject.AddChild(new B());
int size = aobject[0].m_aryChildren.GetSize();