Re: Can't use TComponent in thread object?



If I want to update a label on my form that displays the bytes
downloaded so far, how is that done at a conceptual level? I know what
the code will look like to make all of that happen but conceptually, I
keep running into problems - namely circular references.

Here's what I started doing:
Form1 uses FTPthread
....and creates TFTPthread

TFTPthread uses TProgressthread
....and creates TProgressthread

TProgressthread uses Form1
....and gets a reference to a string property on Form1. TProgressthread
will stay in a loop checking the filesize every 5 seconds or so. It
will sleep in between. TProgressthread is stopped/destroyed by
TFTPthread.

Does this sound like a good model?

Thanks,
Brett

.



Relevant Pages

  • Re: Cant use TComponent in thread object?
    ... how is that done at a conceptual level? ... TFTPthread uses TProgressthread ... your progress thread shouldn't need to have a reference to any form units. ...
    (alt.comp.lang.borland-delphi)
  • Re: Cant use TComponent in thread object?
    ... TFTPthread uses TProgressthread ... TProgressthread uses Form1 ... ....and gets a reference to a string property on Form1. ...
    (alt.comp.lang.borland-delphi)