CFileItemList itemList; // add some file items to the collection itemList.Add("file1.txt"); itemList.Add("file2.txt"); // remove an item itemList.Remove("file1.txt");
CFileItemList* pItemList = new CFileItemList; // add some file items to the collection pItemList->Add("file1.txt"); pItemList->Add("file2.txt"); // remove an item pItemList->Remove("file2.txt"); delete pItemList;
CFileItemList itemList; // use iterator to add some file items to the collection for (POSITION pos = fileList.GetHeadPosition(); pos != NULL;) { CString str = fileList.GetNext(pos); itemList.Add(str); } // remove an item itemList.Remove("file3.txt");In these examples, we add some file items to the CFileItemList collection and then remove an item from the collection using Remove method. The CFileItemList class belongs to the MFC library of Microsoft Foundation Classes.