void FindAllFile(CString path, CString* filenames, int& count)
{
CFileFind finder;
BOOL working = finder.FindFile(path + "\\*.*");
while (working)
{
working = finder.FindNextFileW();
if (finder.IsDots())
{
continue;
}
else if (finder.IsDirectory())
{
continue;
}
else
{
CString filename = finder.GetFileName();
std::cout << "file name:" << filename << std::endl;
filenames[count++] = filename;
}
}
}
int main()
{
CString filenames[1024];
int count = 0;
char path[MAX_PATH];
while (std::cin >> path)
{
FindAllFile(path, filenames, count);
for (int i = 0; i < count; i++)
{
std::cout << (CT2A)(filenames[i].GetBuffer(filenames[i].GetLength())) << std::endl;
}
}
return 0;
}