Hallo,
das ist meinThreadcode:
Delphi-Quellcode:
unit threadtest;
interface
uses
Classes,idtcpclient,dialogs,StdCtrls,sysutils;
type
tmythread =
class(TThread)
private
fclient:tidtcpclient;
fmemo:tmemo;
procedure updatememo;
protected
procedure Execute;
override;
public
constructor create(
const aclient: tidtcpclient;
const amemo: tmemo);
end;
implementation
uses modul;
constructor tmythread.create(
const aclient: tidtcpclient;
const amemo: tmemo);
begin
inherited create(true);
fclient := aclient;
fmemo := amemo;
resume;
end;
procedure tmythread.Execute;
begin
while not terminated
do
if fclient.
then //<- hasdata ???
synchronize(updatememo)
else
sleep(100);
end;
procedure tmythread.updatememo;
begin
fmemo.Lines.Append(fclient.ReadLn);
end;
end.
Was ist in deinem Code wesentlich anders? Oder was soll ich ändern?
Gruß
Spurius