#include "stdafx.h" #include "afx.h" #include "iostream.h" #include "winbase.h" int main(int argc, char* argv[]) { DWORD returnValue; if( SetCurrentDirectory("D:\\Code\\POS") == TRUE) { CFileFind finder; BOOL bWorking = finder.FindFile("*.*"); while (bWorking) { bWorking = finder.FindNextFile(); //cout << (LPCTSTR) finder.GetFilePath(); cout << (LPCTSTR) finder.GetFileName() << endl; } } else { returnValue = GetLastError(); }; return 0; } |