Autor Beitrag
elundril
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3747
Erhaltene Danke: 123

Windows Vista, Ubuntu
Delphi 7 PE "Codename: Aurora", Eclipse Ganymede
BeitragVerfasst: Fr 08.06.07 11:13 
Ich verwende um ein RichEdit (JvRichedit) in einer XML datei zu speichern JvSimpleXML und einen Stream. ich hab mir aus anderen beiträgen zusammengereimt wie das auszusehen hat. nur leider steht in der XML datei nix drinnen wenn man sie aufruft.

der Quellcode aufs wesentliche reduziert:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
procedure TfrmMain.Speichern(Sender: TObject);
var Stream: TStringstream;
begin
  Stream:=TStringstream.create('Stri');
  try
    Richedit1.Lines.SaveToStream(Stream);
    JvSimpleXML.Root.Items.Add('Inhalt',stream);
  finally
    stream.free;
  end;
  JvSimpleXML.SavetoFile('C:\File.xml');
end;


Im Richedit steht fix was drinnen. Jetzt weis ich nicht an was das liegt. kann mir jemand helfen?

lg elundril
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Fr 08.06.07 11:25 
Hallo,

ausblenden Delphi-Quelltext
1:
2:
3:
Richedit1.Lines.SaveToStream(Stream);
Stream.Position := 0;// <----------  
JvSimpleXML.Root.Items.Add('Inhalt',Stream);


Übergib doch einen Leerstring
ausblenden Delphi-Quelltext
1:
Stream := TStringstream.create('');					

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
elundril Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3747
Erhaltene Danke: 123

Windows Vista, Ubuntu
Delphi 7 PE "Codename: Aurora", Eclipse Ganymede
BeitragVerfasst: Fr 08.06.07 11:27 
oh! danke! Vielen dank!

ad 2: ich hab gedacht da muss was drinstehen! danke!

lg el