Autor Beitrag
Thomas233
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 39

Win 2000, Win Xp
Delphi 6 Personal
BeitragVerfasst: Sa 03.05.03 22:51 
Hallo,

ich verwende Indy 9.0 und habe nach korrekter Installation folgendes Problem:

Immer wenn ich mit Indy eine Datei runterlade dann wird das Formular, bei dem der Download erfolgen soll, immer erst nach dem vollständig erfolgten Download angezeigt, also whärend des Downloadvorganges geblockt. Ich verwende IdAntifreeze auf dem Formular, aber das hilft nichts.
Ich hatte dieses Problem mit früheren Indy Versionen aber nie.
Woran kann das liegen? :(

_________________
Mit freundlichen Grüßen
Thomas233
Thomas233 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 39

Win 2000, Win Xp
Delphi 6 Personal
BeitragVerfasst: Sa 03.05.03 23:22 
Ich habe hier noch eine ausführliche Beschreibung der Vorgangsweise meines Programs:

Also zuerst wird ein Splash-Screen angezeit.
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
begin
  StartScreen := TStartScreen.Create(Application);
  try 
    StartScreen.Show; //1.Fenster: Splash
    Application.Initialize;
    StartScreen.Update;
    Sleep(2000); 
    Application.CreateForm(TMainWindow, MainWindow); //2.Fenster: Hauptfenster
    Application.CreateForm(TConnectionModule, ConnectionModule); //3.Fenster: Download    
Application.CreateForm(TForm1, Form1); //restliche Fenster werden erstellt
    Application.CreateForm(TForm2, Form2);
    Application.CreateForm(TForm3, Form3);
    StartScreen.Hide;
  finally 
   StartScreen.Free;
  end;
  Application.Run;
end.


Danach erscheint das Hauptfenster der Anwendung, in dem das Fenster mit dem Downloadvorgang in OnShow hervorgerufen wird.
ausblenden Quelltext
1:
2:
3:
4:
procedure TForm1.Page_ConnectShow(Sender: TObject);
begin
ConnectionModule.ShowModal;
end;

Das Download-Fenster erscheint allerdings erst nach dem Beenden aller Downloads. Genau das ist das Problem, es soll ja davor angezeigt werden.
Der folgende Code wird im OnShow des Download-Fensters ausgeführt:
ausblenden 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:
29:
procedure TConnectionModule.Connect;
var i:Integer;
    DlList: array[0..4] of String;
    responseStream:TFileStream;
begin
try
//4 Dateien sollen heruntergeladen werden
Dllist[0]:='routes';
Dllist[1]:='trains';
Dllist[2]:='utilies';
Dllist[3]:='others';
Dllist[4]:='users';

//Anzeige des Downloadvorganges
ConnectionStatus.Caption:='Aktualisiere lokale Datenbanken...';
ConnectionBar.Max:=4;
ConnectionBar.Position:=0;

for i:=0 to 4 do begin
ConnectionBar.Position:=i;
//Download der Datei mit IdHttp
responsestream:=TFileStream.Create(Form1.ActDir+'database\'+DlList[i]+'.bed', fmCreate);
IdHttp1.Get('http://bveexchange.bve-tools.com/program/database/'+DlList[i]+'.bed',responseStream);
responsestream.Free;
end;
except
raise;
end;
end;

_________________
Mit freundlichen Grüßen
Thomas233
Thomas233 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 39

Win 2000, Win Xp
Delphi 6 Personal
BeitragVerfasst: Do 05.08.04 20:29 
Titel: Problem gelöst!
Hallo,

ich wollte nur noch mitteilen das die Benutzung von Threads DIE Lösung für dieses Problem ist (beim IdHttp-Client sowie beim IdFtp-Client) !

_________________
Mit freundlichen Grüßen
Thomas233