[Lazarus] how to TXMLPropStorage SaveToStream() LoadFromStream

Virgo Pärna virgo.parna at mail.ee
Thu Jul 3 10:34:29 CEST 2014


On Wed, 02 Jul 2014 19:19:48 +0300, FreeMan <freeman35 at delphiturkiye.com> wrote:
>
> procedure TForm1.Button1Click(Sender: TObject);
> var st : TMemoryStream;
> begin
> try
> st := TMemoryStream.Create;

You should creat st before try. Or at least set st to nil. 

> TmyCustomXMLPropStorage(XMP).XMLConfig.SaveToStream(st);

You save data to the stream.

> memo1.Lines.LoadFromStream(st);

    And now you read 0 bytes from stream (because current position of stream 
is at the end of stream.

> and result :
> Project project1 raised exception class 'External: SIGSEGV'.
>

    At which line that error occured? 
    TXMLConfig does not seem to have SaveToStream method. Which class has this method?


-- 
Virgo Pärna 
virgo.parna at mail.ee





More information about the Lazarus mailing list