PedanticProgrammer
Programmer
I am using FindFirst/Next?Close to examine the contents of a folder. The code looks like this:
LocalPath += AnsiString("C:\\Progrram Files\\InDesign\\Plugins\\*.*");
Result = FindFirst(LocalPath, Attributes, TheFile);
...
Result = FindNext(TheFile);
...
FindClose(TheFile);
The first time through, this code works as expected. However, the next time in the same session that I go through this code, the call to FindFirst (with the exact same parameters) produces a return code of 3. I have two questions, really. The documentation describes the return value as a "Windows error code" but searching for "Windows error code" produces no further documentation. So what does a return code of 3 mean? And, does any one know why this code works correctly the first time but not during subsequent operations?
LocalPath += AnsiString("C:\\Progrram Files\\InDesign\\Plugins\\*.*");
Result = FindFirst(LocalPath, Attributes, TheFile);
...
Result = FindNext(TheFile);
...
FindClose(TheFile);
The first time through, this code works as expected. However, the next time in the same session that I go through this code, the call to FindFirst (with the exact same parameters) produces a return code of 3. I have two questions, really. The documentation describes the return value as a "Windows error code" but searching for "Windows error code" produces no further documentation. So what does a return code of 3 mean? And, does any one know why this code works correctly the first time but not during subsequent operations?