Link to home
Start Free TrialLog in
Avatar of rfedyk
rfedyk

asked on

FindFirst fails under Win2K when called from inside a thread.

FindFirst fails under Win2K when called from inside a thread.

The error message says that an Access Violation has occurred in NTDLL.DLL. I have traced this in the debugger and the failure occurrs on a CMP instruction.

Does anyone have any clues?
ASKER CERTIFIED SOLUTION
Avatar of inthe
inthe

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Madshi
Madshi

Please post your FindFirst loop source code, if Barry's (inthe's) comment doesn't help.

Regards, Madshi.
Avatar of rfedyk

ASKER

Thanks Inthe,

After reading the Google comments I decided to abandon the FileFirst, FileNext, FileClose construct anyway and use a hidden TFileListBox. I'm only interested in the first file that appears in the chosen directory (which is ultimately moved to another directory) and call the Update method on each Thread pass.

I found another problem which is annoying as well. I have a descendant TFileStream class which I use often. Under Win2K and WinXP the inherited Read method does not return the number of bytes read. Instead it returns the number bytes requested.