CFileItemList fileList; fileList.AddItem(_T("C:\\folder1\\file1.txt")); fileList.AddItem(_T("C:\\folder2\\file2.txt")); CString path = fileList.GetPath(0); TRACE(_T("Path of item at index 0: %s"), path.GetString());
CFileItemList dirList; dirList.AddDirectory(_T("C:\\folder1")); dirList.AddDirectory(_T("C:\\folder2")); CString path = dirList.GetPath(1); TRACE(_T("Path of item at index 1: %s"), path.GetString());This example creates a CFileItemList object and adds two directories to it. The GetPath method is then used to retrieve the path of the directory at index 1 in the list. Package library: MFC (Microsoft Foundation Class) library.