Re: Can't use TComponent in thread object?
- From: Jamie <jamie_ka1lpa_not_valid_after_ka1lpa_@xxxxxxxxxxx>
- Date: Wed, 22 Nov 2006 21:01:03 -0500
brett wrote:
I've added a Thread Object named TProgressThread to my Delphi7 Win32use Nil not Self.
project. I created this method in the unit:
procedure TProgressThread.GetRemoteFile;
begin
FtpClient1 := TFtpClient.Create(Self);
...
end;
I get this error when compiling:
[Error] ProgressThread.pas(72): Incompatible types: 'TComponent' and
'TProgressThread'
Line 72 is the FtpClient1 line above. I'm trying to put the
downloading of a file on its own thread. Why can't I use the
FtpClient1 object in the thread class?
Thanks,
Brett
your Thread class isn't a compatible class for an owner because it
does not have a Tcomponent in it most likely. it's only an owner any ways, you just need to clean it up your self before you destroy the
thread.
also, since you obviously are doing this in a thread, i guess you will
need to use blocking sockets.
--
"I'm never wrong, once i thought i was, but was mistaken"
Real Programmers Do things like this.
http://webpages.charter.net/jamie_5
.
- Follow-Ups:
- Re: Can't use TComponent in thread object?
- From: brett
- Re: Can't use TComponent in thread object?
- References:
- Can't use TComponent in thread object?
- From: brett
- Can't use TComponent in thread object?
- Prev by Date: Re: hexadecimal calculating: turning on the high bit
- Next by Date: Re: hexadecimal calculating: turning on the high bit
- Previous by thread: Can't use TComponent in thread object?
- Next by thread: Re: Can't use TComponent in thread object?
- Index(es):