自已定义一个.h文件,然后,在里面加入类的定义
class CPartA : public CObject
{
public:
CPartA() {}
virtual ~CPartA() {}
int m_a;
int m_b;
CString m_c;
int m_d;
};
typedef CTypedPtrListCObList, CPartA* CPartAList;//重点在这儿
class CInfoA
{
public:
CInfoA() {}
virtual ~CInfoA();
BOOL AddData(int a, int b, CString c, int d); //用于加入数据的
CPartA m_objects;
};
在.cpp里
CInfoA的析构
CInfoA::~CInfoA()
{
POSITION pos = m_objects.GetHeadPosition();
while (pos != NULL)
...[ 查看全文 ]