Autor Beitrag
Niko S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 566
Erhaltene Danke: 10

Win 7, Ubuntu
Lazarus, Turbo Delphi, Delphu 7 PE
BeitragVerfasst: So 15.10.06 17:37 
Also ich hab mir mal erlaubt so ein autopatcher mit unrar zu bauen.
Das problem ist nun, dass er bei Filestream.Free ne zugriffsverletzung macht :(
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:
 if listbox2.Items.Strings[0] <> '' then begin
      idHTTP1.Head('http://~/l2/patch/'+listbox2.items[0]);
      bins := IdHTTP1.Response.ContentLength;
      if bins = -1 then
        showmessage('Files doesnt exist! Please contact Administrator!')
      else begin
        gauge1.maxvalue := bins;
        FileStream := TFileStream.Create(listbox2.items[0], fmCreate);
        Application.ProcessMessages;
        timer1.Enabled := True;
        try
          IdHttp1.Get('http://~/l2/patch/'+listbox2.items[0], FileStream); //downlaoden tut er !
          Application.ProcessMessages;
        finally                              //bis hier hin alles super
          FileStream.Free; //Da hackts
          dfunrar1.directory := extractfiledir(application.exeName); //ab hier funktionierts (wenn FileStream.Free funktionieren würde)
          dfunrar1.filename := extractfiledir(application.exeName)+'\'+listbox2.Items[0];
          dfunrar1.Extract;
          Application.ProcessMessages;
        end; 
      end;  
  end;

Ja ich bekomme da so viele fenster das ich das über taskmanager schließen muss oder das program sich von selbst abwürgt...
wulfskin
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1349
Erhaltene Danke: 1

Win XP
D5 Pers (SSL), D2005 Pro, C, C#
BeitragVerfasst: So 15.10.06 18:14 
Hallo,

was kommt den für eine Fehlermeldung in Delphi? So auf den ersten Blick kann ich nichts erkennen, außer das der Quelltext grausam ist ..:/

Gruß Hape!

_________________
Manche antworten um ihren Beitragszähler zu erhöhen, andere um zu Helfen.
Niko S. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 566
Erhaltene Danke: 10

Win 7, Ubuntu
Lazarus, Turbo Delphi, Delphu 7 PE
BeitragVerfasst: So 15.10.06 18:17 
Erm in welcher Art ist der Grausam? Ich weis selbst, dass mir noch die richtige formatierung fehlt ;).

Und die fehler sehen so aus:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
---------------------------
Project1
---------------------------
Zugriffsverletzung bei Adresse 0041B207 in Modul 'Project1.exe'. Lesen von Adresse 00000018.
---------------------------
OK   
---------------------------

Achja und das um die 50 mal ... bis das programm explodiert.
wulfskin
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1349
Erhaltene Danke: 1

Win XP
D5 Pers (SSL), D2005 Pro, C, C#
BeitragVerfasst: So 15.10.06 18:23 
Naja, grausam deshalb, wegen Application.ProcessMessages. Ich kann mir nicht vorstellen, dass diese Fehlermeldung in Delphi kommt. Was wird denn davor ausgerufen, was sagt der Debugger?

_________________
Manche antworten um ihren Beitragszähler zu erhöhen, andere um zu Helfen.
Niko S. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 566
Erhaltene Danke: 10

Win 7, Ubuntu
Lazarus, Turbo Delphi, Delphu 7 PE
BeitragVerfasst: So 15.10.06 18:25 
EDIT:
Hat sich erledigt ich darf wohl keine FileStreams als "globale" Variable setzen ... hab sie in der procedure eingebunden und bsciehn adners benannt und schon klappt alles perfekt ^^.
Ich hab die Application.ProcessMessages;
Fast alle entfehrnt ^^ einen musste ich da lassen weil das programm sonst solang wie er downloadet einfriert :(