We help IT Professionals succeed at work.

FindFirst fails under Win2K when called from inside a thread.

rfedyk
rfedyk asked
on
Medium Priority
184 Views
Last Modified: 2010-05-18
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?
Comment
Watch Question

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

Regards, Madshi.

Author

Commented:
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.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.