|Subject:||Re: Get Download Status; C++; IdFTPClient|
|Posted by:||Remy Lebeau (TeamB) (email@example.com)|
|Date:||Wed, 7 Sep 2005|
"Joe Pool" <jpo…@letourneau-inc.com> wrote in message
> How can I determine the progress of a download (i.e. to
> update a Progress Bar)?
Use the OnWork events.
> TIdFTPListItem* Item = new TIdFTPListItem(NULL);
> Item = IdFtp1->DirectoryListing->Items[i++];
That is a memory leak. You are allocating a new object that you never use.
The first time the loop executes, you are re-assigning the pointer value to
pointer to another object, thus losing the pointer to the memory you
> FileStream = new TFileStream("C:\setup.exe", fmCreate |
You are missing a slash in the filename. You must always escape forward
slashes in string/character literals:
FileStream = new TFileStream("C:\\setup.exe", fmCreate |
> i = IdFtp1->DirectoryListing->Count + 1; // forces to exit the
Use a 'break' statement instead to exit the loop.
Get Download Status; C++; IdFTPClient posted by Joe Pool on Wed, 7 Sep 2005