New
#1
odd results using Borland's FindFirst function
After using Win7 for several months, suddenly getting odd file attribute values using FindFirst|FindNext VCL functions using Borland C++ Builder6 Enterprise.
The following code worked fine (for years in several versions of Windows)
TSearchRec sr;
int iAttributes = faDirectory;
if (FindFirst("*.*", iAttributes, sr) == 0)
{
if((sr.Name!=".") && (sr.Name!= ".."))
ListBox1->Items->Add(sr.Name);
while (FindNext(sr) == 0)
if((sr.Name!=".") && (sr.Name!= ".."))
ListBox1->Items->Add(sr.Name);
}
FindClose(sr);
This writes all directories within a selected directory to a listbox.
Only it doesnt do this all of a sudden.
TSearchRec.Attr has begun to return a value of 0x2010 regardless of whether the file pointed to is a directory or a hidden|system|Any file!
Which means my listbox is filled with every file|directory in the specified dir, and not just the intended directories.
Can anybody make sense out of this? Is this a virus? Or is it a Win7 "feature" that packs more values into a file attribute?