And Murphy's law of programming strikes again. An old section of code that was working up untill today has ceased functioning without being changed and for no apparent reason.
I posted the code below. FindFirstFile() is returning and INVALID_HANDLE_VALUE and GetLastError() returns 3 (how do I find out what that means???). The path and pattern given is perfectly valid, and what's more has worked in the past and hasn't been changed since. I'm not certain what's gone wrong or how to address the problem. I've spent the last 3 hours trying to though :-(. Does anybody have any wisdom to share?
vector<string> Directory::GetFiles(string path, const char * pattern)
HANDLE handle = FindFirstFile((path + pattern).c_str(), &fd);
if(handle == INVALID_HANDLE_VALUE)
files.resize(0); //set the size to 0 so we can't iterate through the vector
files.push_back(path + fd.cFileName);
} while(FindNextFile(handle, &fd));