若定义结构体:
struct stColor
{
int nRow;
int nCol;
COLORREF rgb;
BOOL bSet;
};
且添加
stColor *pColor = new stColor;
pColor->nCol = col;
pColor->rgb = color;
pColor->bSet = bSet;
m_ptrListCol.AddTail(pColor);
若m_ptrListCol不处理,则会存在泄露;需在析构中对其进行处理:
while(!m_ptrListCol.IsEmpty())
delete(stColor*)(m_ptrListCol.RemoveHead());
m_ptrListCol.RemoveAll();