CFileItemList fileList; CFileItem newItem(_T("myfile.txt"), false); // create a new file item fileList.Append(newItem); // add the new file item to the list
CFileItemList fileList; CFileItem item1(_T("myfile.txt"), false); CFileItem item2(_T("mydirectory"), true); fileList.Append(item1); fileList.Append(item2);Here, we create an empty list of file items as before. We then create two new file items, item1 and item2. Item1 represents a file called "myfile.txt" and item2 represents a directory called "mydirectory". We use the Append function twice to add these items to the end of the fileList. Overall, the CFileItemList class with its Append function is part of the MFC library, which is a set of classes and functions that simplify the development of Windows-based applications.