Autor Beitrag
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10183
Erhaltene Danke: 1256

W10ent
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Mo 21.08.06 14:45 
Moin!

user profile iconSina4ever hat folgendes geschrieben:
pieps.FreeOnTerminate := true; hinzugefügt..

Das ist unsauber aus dem Hauptthread heraus, das gehört in den Konstruktor (du weißt ja schließlich nicht, wie schnell der Thread terminiert...).

user profile iconSina4ever hat folgendes geschrieben:
Kannst du mir jetzt noch sagen wie ich dem Thread, oder eher gesagt dem idhttp1.get eine url aus der Hauptform mit übergeben kann?

Z.B. über den Konstruktor und eine lokale Variable des Threads:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
type
  THttpThread = class(TThread)  
  private  
    FURL: String;
  public  
    constructor Create(const AURL: String);  
    procedure Execute; override;  
  end;  

constructor THttpThread.Create(const AURL: String);  
begin  
  inherited Create(FALSE); // direkt starten  
  FreeOnTerminate := TRUE; // Objekt freigeben, wenn fertig  
  FURL := AURL; // Adresse übernehmen
end;  

// im Hauptthread der Anwendung:
MyThread := THttpThread.Create('http://www.google.de');

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.