FindFirstFile and FindNextFile

Jan 1, 2013 at 9:29pm
Let's say you have the following declarations:
1
2
HANDLE h;
WIN32_FIND_DATA fd;

and you set h = FindFirstFile((dir+"/*.").c_str(), &fd);
If you were to use
1
2
3
4
while ((((string)fd.cFileName == ".") || ((string)fd.cFileName == "..")) && (FindNextFile(h,&fd)))
{
 //Do nothing because FindNextFile is changing fd.cFileName
} //end while 

will FindNextFile(h,&fd) change h?
In other words, would
FindNextFile(FindFirstFile((dir+"/*.").c_str(), &fd), &fd) mean the same as FindNextFile(h, &fd)?
Last edited on Jan 1, 2013 at 9:38pm
Jan 2, 2013 at 12:06am
I'm not perfectly sure what you are asking with your last example, but h is the handle to the file, and FindNextFile() doesn't alter the handle.
Jan 2, 2013 at 12:44am
That was what I was asking.
Topic archived. No new replies allowed.