trichview.com

trichview.support




Re: LoadTextFromStream problem


Return to index


Author

Message

Chris Booth

Posted: 12/15/2004 22:47:03


Pieter E. wrote:

> Dear Chris,

>

> You should add the following line to your source:

>   Stream.Position := 0;

>

> The source should be:

>

>   Stream := TMemoryStream.Create;

>   List.SaveToStream( Stream );

>   Stream.Position := 0;

>   RichViewEdit1.LoadTextFromStream( Stream, 0, 0, False );

>   RichViewEdit1.Format;

>   FreeAndNil( Stream );

>

> You should always set the position back to zero when saving to a stream.

>

> Good luck.

>

> Pieter E.

>

>

> Chris Booth <no.spam@adcl.com> wrote:

>

>>Hello,

>>

>>I'm evaluating your product.  First let me say that it looks VERY nice

>>and has a lot of good features.

>>

>>I've run into one issue that I'm not sure how to resolve though.  I am

>>trying to load text from a string list via a TMemoryStream, but when I

>>use the LoadTextFromStream method, the text does not display in the

>>RichViewEdit component.  Here is the code I'm using:

>>

>>    Stream := TMemoryStream.Create;

>>    List.SaveToStream( Stream );

>>    RichViewEdit1.LoadTextFromStream( Stream, 0, 0, False );

>>    RichViewEdit1.Format;

>>    FreeAndNil( Stream );

>>

>>I'm sure that I'm missing something, but I can't figure out what.

>>

>>Any ideas?

>>

>>TIA,

>>

>>Chris Booth

>

>

Thanks Pieter.  Worked like a champ!


Guess you'll have to take my Guru status away :)





Powered by ABC Amber Outlook Express Converter