今天用到CImageList,用到Remove函数按照网上http://www.codeproject.com/Articles/4990/Thumbnails-Viewer-using-ListCtrl的
CImageList* pImgList=&pView->m_ImageListThumb; // reset our image list for(int i=0; i<pImgList->GetImageCount(); i++) pImgList->Remove(i);效果是ImageList没有彻底删除,查资料。
All items following nImage now move down one position. For example, if an image list contains two items, deleting the first item will cause the remaining item to now be in the first position. nImage=0 for the item in the first position.
应该永远删除第一个元素,知道结束。
int nCount = pImgList->GetImageCount();
// reset our image list
for(int i=0; i<nCount ; i++) pImgList->Remove(0);