Autor Beitrag
DerHorst
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 31

windows200
delphi 6 PE
BeitragVerfasst: Sa 09.10.04 12:53 
grüß euch.

ich möchte ein bild aus dem netz in einen memory stream laden.
jedoch kommt bei IdHTTP1.Get beim ausführen in delphi immer folgende fehlermeldung:

project xy.exe raised exception class EIdconnClosedGracefully with message 'Connection Closed Gracefully.'.
Process stoppt. usw step or run to continue.


ausserhalb von delphi läuft die exe.

hier mein code.

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:
procedure tform1.getdata;
var
mm : TMemoryStream;
GIF : TGIFImage;
Bitmap : TBitmap;

begin


mm := TMemoryStream.Create;
GIF := TGIFImage.Create;

    try  

    IdHTTP1.Get('http://mcsky.mc.funpic.de/debilsoft/donate.gif', mm);
    mm.Position := 0;
    gif.LoadFromStream(mm);
    image1.Picture.Bitmap.Assign(gif);
   
    except
    
    end;

mm.Free;
.
.
.


grüße

horst
Martin77
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 282

XP Prof
D6 Prof, D7 Personal, D7 Enterprise, D8 personal
BeitragVerfasst: Sa 09.10.04 13:13 
Haste die Delphi Exceptions an? Falls nein schalt sie mal unter den Debugging Optionen an. Und lass dein Programm dann aus Delphi raus laufen.

Die Indy Entwickler haben DIESE Exception direkt im Quelltext an der Stelle beschrieben wo sie auftritt.


Gruß Martin
DerHorst Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 31

windows200
delphi 6 PE
BeitragVerfasst: Sa 09.10.04 14:10 
danke für den tip! ich habe diese exception hunzügefügt und die meldung kommt nicht mehr.

das is der text von indy

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:
if LDisconnected then begin
    // Do not raise unless all data has been read by the user
    if ((InputBuffer.Size = 0) or AIgnoreBuffer) and ARaiseExceptionIfDisconnected then begin
      (* ************************************************************* //
      ------ If you receive an exception here, please read. ----------

      If this is a SERVER
      -------------------
      The client has disconnected the socket normally and this exception is used to notify the
      server handling code. This exception is normal and will only happen from within the IDE, not
      while your program is running as an EXE. If you do not want to see this, add this exception
      or EIdSilentException to the IDE options as exceptions not to break on.

      From the IDE just hit F9 again and Indy will catch and handle the exception.

      Please see the FAQ and help file for possible further information.
      The FAQ is at http://www.nevrona.com/Indy/FAQ.html

      If this is a CLIENT
      -------------------
      The server side of this connection has disconnected normaly but your client has attempted
      to read or write to the connection. You should trap this error using a try..except.
      Please see the help file for possible further information.

      // ************************************************************* *)

      raise EIdConnClosedGracefully.Create(RSConnectionClosedGracefully);
    end;
  end;


es muss ja eigentlich was falsch sein an meinem code (The server side of this connection has disconnected normaly but your client has attempted)
??? aber was?


grüße

horst