trichview.support
Re: LoadTextFromStream problem |
Author |
Message |
Pieter E. |
Posted: 12/15/2004 22:36:08 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 <[email protected]> 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 |
Powered by ABC Amber Outlook Express Converter