Hallo,
wenn ich die Kombo idhttp in delphi schiebe und läßt sich das Programm mit AntiFreez und den Eintrag Application.ProcessMessages; in OnWork beheben.
Ich muss allerdings ein IDHTTP Object anlegen.
Nun versuche ich OnWork und OnWorkBegin von der IDHTTP1 Kombo zu gethttp zuzuweißen.
Es funktioniert aber nicht, warum?
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28:
| procedure TForm1.IdHTTP1Work(ASender: TObject; AWorkMode: TWorkMode; AWorkCount: Integer); begin Application.ProcessMessages; end;
procedure TForm1.IdHTTP1WorkBegin(ASender: TObject; AWorkMode: TWorkMode; AWorkCountMax: Integer); begin Application.ProcessMessages; end;
begin gethttp := TIdHTTP.Create( Application ); gethttp.readtimeout := form1.IdHTTP1.ReadTimeout; gethttp.connecttimeout := form1.IdHTTP1.connectTimeout; gethttp.handleredirects := true; gethttp.OnWork := form1.idhttp1Work; gethttp.OnWorkBegin := form1.idhttp1WorkBegin;
try sssget := gethttp.get(sss); except on E: Exception do sleep(1); end; gethttp.disconnect; gethttp.free; end; |