Autor Beitrag
Dude566
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1592
Erhaltene Danke: 79

W8, W7 (Chrome, FF, IE)
Delphi XE2 Pro, Eclipse Juno, VS2012
BeitragVerfasst: Di 12.05.09 17:10 
Also ich habe in meinem FTP CLient jetzt die AntiFreeze Komponente von Indy einbauen wollen damit das Formular nicht hängt während eines Down- und Uploads.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
private
  MyFTP : TIdFTP;
  AntiFreeze : TIdAntiFreeze;

// On Create
procedure TForm1.FormCreate(Sender: TObject);
begin
     MyFTP := TIdFTP.Create(Self);
     AntiFreeze := TIdAntiFreeze(Self);
     AntiFreeze.Active := true;
     AntiFreeze.OnlyWhenIdle := false;
end;


Beim kompilieren bekomme ich die Fehlermeldung " Zugriffsverletzung in blabla...".

Dann öffnet sich Projekt1:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
program Project1;

uses
  Forms,
  Unit1 in 'Unit1.pas' {Form1};

{$R *.RES}

begin
  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  Application.Run;
end.


Das Highlight sieht in Delphi dann blau aus.

Was is das? Das vor der Komponente nicht so.

Gruß Dude566

_________________
Es gibt 10 Gruppen von Menschen: diejenigen, die das Binärsystem verstehen, und die anderen.
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Di 12.05.09 17:54 
Moin!

Das IdAntiFreeze-Zeuchs ist Schrott, pack den Up-/Download in einen Thread, fertig. :idea:

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
Xentar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2077
Erhaltene Danke: 2

Win XP
Delphi 5 Ent., Delphi 2007 Prof
BeitragVerfasst: Di 12.05.09 18:25 
1. Bekommst du die Zugriffsverletzung nicht beim kompilieren - sondern beim starten..
2. Du hast das nicht wirklich SO da stehen, oder?
ausblenden Delphi-Quelltext
1:
AntiFreeze := TIdAntiFreeze(Self);					

Damit versuchst du gerade, das Formular (self) als IdAntiFreeze Komponente anzusprechen.. kein Wunder dass das nicht geht.
3. Wie Narses schon sagte, ist nen eigener Thread noch am schönsten.

_________________
PROGRAMMER: A device for converting coffee into software.
Dude566 Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1592
Erhaltene Danke: 79

W8, W7 (Chrome, FF, IE)
Delphi XE2 Pro, Eclipse Juno, VS2012
BeitragVerfasst: Di 12.05.09 20:45 
Wie geht das mit eigenen Threads bzw. was ist das?

Vielleicht einen Link zu einem Beispiel?

Edit: Hatte .Create vergessen
ausblenden Delphi-Quelltext
1:
AntiFreeze := TIdAntiFreeze.Create(self);					

_________________
Es gibt 10 Gruppen von Menschen: diejenigen, die das Binärsystem verstehen, und die anderen.
Xentar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2077
Erhaltene Danke: 2

Win XP
Delphi 5 Ent., Delphi 2007 Prof
BeitragVerfasst: Di 12.05.09 20:56 
Such mal nach TThread, da sollten sich genug Beispiele finden. Soweit ich weiß ist sogar bei Delphi eien Demo dabei.

Geht das nun, mit dem Create?

_________________
PROGRAMMER: A device for converting coffee into software.
Dude566 Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1592
Erhaltene Danke: 79

W8, W7 (Chrome, FF, IE)
Delphi XE2 Pro, Eclipse Juno, VS2012
BeitragVerfasst: Di 12.05.09 21:07 
Ja, nun klappt es.

Auch wenn es ein wenig lahm reagiert, so bleibt es wenigstens nicht komplett hängen wie ohne AntiFreeze.

_________________
Es gibt 10 Gruppen von Menschen: diejenigen, die das Binärsystem verstehen, und die anderen.