I keep getting compile errors with the line at the bottom
hFind = FindFirstFile(fileFilter.c_str()), &FindFileData);
The compiler keeps throwing error C2664 back at me, : cannot convert argument 1 from 'const char *' to 'LPCWSTR'
How do I create a LPCWSTR to a std::string to pass to into FindFirstFile?
Zhe section of code is for reference.
The actual code follows below.
using namespace std;
void GetFileListing(string directory, string fileFilter, bool recursively = true)
{
if (recursively)
GetFileListing(directory, fileFilter, false);
directory += "\\";
WIN32_FIND_DATA FindFileData;
HANDLE hFind ;
string filter = directory + (recursively ? "*" : fileFilter);
string Full_Name;
string Part_Name;
// the line causing the compile error
hFind = FindFirstFile(fileFilter.c_str()), &FindFileData);