I have this:
MaxCuts = 5;
WIN32_FIND_DATA fname;
bool found = true;
HANDLE hfile = FindFirstFile((directory + "*".c_str(), &fname);
if (!SetCurrentDirectory(directory.c_str()))
{
WriteToLog("Unable to access " + directory);
return;
}
String filename;
int error;
TStringList* list = new TStringList;
if (hfile != INVALID_HANDLE_VALUE)
{
do
{
AnsiString s = (AnsiString)fname.cFileName;
if (fname.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
{
if (s != "." && s!= ".."
{
ShowMessage(directory + s + "\\"
}
}
else
{
ShowMessage("I am here"
filename = fname.cFileName;
ShowMessage(filename);
list->Add(filename);
}
}
while(FindNextFile(hfile, &fname));
FindClose(hfile);
}
directory is set to C:\incoming and I have 8 files in it that look like this:
12345678.123 (sample filename)
Why is it when I ShowMessage(s), I get incoming as the filename and not 12345678.123?
Thanks
Mindy
MaxCuts = 5;
WIN32_FIND_DATA fname;
bool found = true;
HANDLE hfile = FindFirstFile((directory + "*".c_str(), &fname);
if (!SetCurrentDirectory(directory.c_str()))
{
WriteToLog("Unable to access " + directory);
return;
}
String filename;
int error;
TStringList* list = new TStringList;
if (hfile != INVALID_HANDLE_VALUE)
{
do
{
AnsiString s = (AnsiString)fname.cFileName;
if (fname.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
{
if (s != "." && s!= ".."
{
ShowMessage(directory + s + "\\"
}
}
else
{
ShowMessage("I am here"
filename = fname.cFileName;
ShowMessage(filename);
list->Add(filename);
}
}
while(FindNextFile(hfile, &fname));
FindClose(hfile);
}
directory is set to C:\incoming and I have 8 files in it that look like this:
12345678.123 (sample filename)
Why is it when I ShowMessage(s), I get incoming as the filename and not 12345678.123?
Thanks
Mindy