Autor Beitrag
Biarchiv
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 688



BeitragVerfasst: So 21.01.07 20:53 
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?

ausblenden 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;
Biarchiv Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 688



BeitragVerfasst: Mi 24.01.07 10:30 
Hallo,

wie kann ich richtig OnWork und OnWorkBegin richtig zu gethttp zuweißen?
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Mi 24.01.07 11:01 
so wie du das gemacht hast ist das doch richtig !
Biarchiv Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 688



BeitragVerfasst: Mi 24.01.07 19:32 
user profile iconmatze hat folgendes geschrieben:
so wie du das gemacht hast ist das doch richtig !


Hey,

das glaube ich selbst auch, nur frist das Programm drotzdem wie OnWork nicht
ausgeführt wird.

Wenn man die Kombo auf das Formblatt zieht geht es.
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Mi 24.01.07 22:44 
das ist komisch.
Probier mal folgendes:
ausblenden Delphi-Quelltext
1:
gethttp := TIdHTTP.Create( form1 );					

Und dann setzt mal die Eigenschaft OnlyWhenIdleder IdAntiFreeze auf False