I'm following a simple tutorial (the adrianxw.dk one) to list the files in a directory. The code is this:
However when I try to compile it using Visual C++ Express, I'm given the following error:Code:#include <windows.h> #include <iostream> using namespace std; int main() { HANDLE hFind; WIN32_FIND_DATA FindData; cout << "A very basic FindFirst/Next demo.\n" << endl; // Find the first file hFind = FindFirstFile("C:\\Windows\\*.exe", &FindData); cout << FindData.cFileName << endl; // Look for more while (FindNextFile(hFind, &FindData)) { cout << FindData.cFileName << endl; } // Close the file handle FindClose(hFind); return 0; }
Can someone please explain what's going wrong?Code:error C2664: 'FindFirstFileW' : cannot convert parameter 1 from 'const char [17]' to 'LPCWSTR'



LinkBack URL
About LinkBacks



