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:"Remy Lebeau (TeamB)" (no.spam@no.spam.com)
Date:Tue, 9 May 2006 01:34:16

"Barry Wood" <Barry@AMSS.uk.com> wrote in message
news:44604898@newsgroups.borland.com...

> 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?

No, that is not correct.  As Martin already told you, which thread the
events are triggered in depends on which thread is calling Put() to begin
with.  TIdFTP itself is not multi-threaded at all.  The OnWork events are
triggered in the context of the same thread that calls Put().  If you are
calling Put() in the context of the main thread, then the event handlers can
safely access the GUI directly.  If you are calling Put() in the context of
a worker thread instead, then you must synchronize access to the GUI.


Gambit

Replies:

none

In response to:

www.cryer.info
Managed Newsgroup Archive