Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 May : Re: Progress Bar for an FTP Transfer

www.cryer.info
Managed Newsgroup Archive

Re: Progress Bar for an FTP Transfer

Subject:Re: Progress Bar for an FTP Transfer
Posted by:"Barry Wood" (bar..@amss.uk.com)
Date:Tue, 9 May 2006 08:45:38

Remy

That was an unclear statement (mine, I mean)! I can figure how to use the
event, what I'm unclear about is when to use the event. I've done no
multi-threading programming (so far) and I'm guessing the only way to get
the OnWork event values (to update a progress bar) whilst the put is active
is to have a separate thread. Is this correct?

If so, I'll need to swot up on how, exactly, I can do this ...

"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message
news:445f9c1c$1@newsgroups.borland.com...
>
> "Barry Wood" <Barry@AMSS.uk.com> wrote in message
> news:445ef7a3$1@newsgroups.borland.com...
>
>> Yes, Indy has those events. I'm not unclear how I go about getting
>> the info from them.
>
> What exactly is unclear about them?
>
>> I have a 'put' to transfer the file and I know the size: how do I get
>> the 'progress' points?
>
> When you upload a file, the OnWorkBegin event will tell you the size of
> the
> file being uploaded.  Set your progress bar's Max property to that value.
> Then the OnWork event is triggered periodically during the transfer to
> tell
> you the number of bytes that have been triggered so far.  Set your
> progress
> bar's Position property to that value.  When the OnWorkEnd event is
> triggered, the transfer has finished, so reset your progress bar as
> needed.
>
>> Would I need a separate thread running to get the updates from OnWork?
>
> No.  They are triggered in the same thread that is calling Put().
>
>
> Gambit

Replies:

In response to:

www.cryer.info
Managed Newsgroup Archive