|
-
Feb 19th, 2002, 04:06 PM
#1
Thread Starter
Member
FindFirstFile Problems...
I'm using the FindFirstFile (in conjuntion with the FindNextFile) API call and it seems to be acting a little funky. I have a function that I pass a directory name to. The function will then use the FindFirstFile / FindNextFile API calls to get information on the files in the directory.
Using the same data, sometimes it works and sometimes it doesn't. When it doesn't work, the return value is -1 (FILE_INVALID_HANDLE).
I have tried to use the GetLastError API immediately after and always get a "0" back as the return value.
I discovered that if I set a break point on the line that calls FindFirstFile and wait a few seconds, it's usually successful. That being the case, I added a 3.5 second delay using the SleepEx API. Again, sometimes it works, sometimes it doesn't.
Has anyone run into a similar problem? I'm not quite sure what else to try!
Frustrated in Connecticut.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|