CListCtrl m_cReport;
...
int pos=0;
CString strLoginID;
CString name;
CString area;
...
m_cReport.InsertItem(pos,strLoginID,0);//账号
m_cReport.SetItemText(pos,1,name);//姓名
m_cReport.SetItemText(pos,2,area);//地区
...
向列表里插入数据,为了使每次插入数据时不显示上次插入的数据,
在插入前用m_cReport.DeleteAllItems();//清空列表内容
出现了问题,第一次插入数据时都可以显示,第二次开始就不行了,
只能显示账号,而姓名和地区不能显示了。把m_cReport.DeleteAllItems();这句删除,又正常了。
请问这是什么原因引起的?谢谢
|