Original Post
I'm having a really hard time trying to get a Path to work with FindFirstFile.. Heres my fuction at present..
What i'm trying to do is.. I have a
std::string LOGPATH;
This holds the path to where i want to find the files.. but i can't figure out how to get it to work in place of this...
h = FindFirstFile("l*.log", &wfd);
the "l*.log" is the while card i want to find in the directory.. but how do i insert the path in.. I keep getting need char.. And so i tried this...
It compiles ok and everything, but when i run it i get a memory exception error in windows.. Anyone know whats wrong?
[edited by - tonic151 on June 13, 2002 4:40:36 PM]
WIN32_FIND_DATA wfd;
HANDLE h;
LOGNAME log;
h = FindFirstFile("l*.log", &wfd);
if(h != INVALID_HANDLE_VALUE) {
// Do Junk Here..
}
while(FindNextFile(h, &wfd)) {
// Do More junk Here
}
}
FindClose(h);
string tpath = LOGPATH;
tpath += tpath+"l*.log";
TCHAR file[256];
and char file[256]; // Both of these do the same...
strcpy(file,tpath.c_str());
h = FindFirstFile(file, &wfd);