trichview.com

trichview.support




Having trouble with LoadRVFFromStream


Return to index


Author

Message

Carlton Craighead

Posted: 01/30/2005 4:18:12


I am attempting to save the contents of a TRichViewEdit to a stream and

eventually restore it at a later time.  It appears SaveRVFToStream is

operating correctly.


But attempting to use LoadRVFFromStream puts the control into what looks

like a read only state.  The caret does not show (even when clicking in the

control ) and typing a keystroke produces an EListError exception (List

index out of bounds (-1)).  The topmost RV-related line in the call stack

after this exception is TRVEditRVData.InsertTextTyping.


So I thought I'd take a step back and try a new small project.  It contains

2 TRichViewEdits (rv1 and rv2), an RVStyle and a button.  The button

procedure


procedure TForm1.Button1Click(Sender: TObject);

var

  st: TMemoryStream;

begin

  st := TMemoryStream.Create;

  rv1.SaveRVFToStream(st, false);

  st.Seek(0, 0);

  rv2.LoadRVFFromStream(st);

  st.Free;

end;



This example exhibits the same problem.  Converting it to support RTF does

not place any text in the second control, but also not not throw and

exception when typing.  As a sanity check, converting it to use 2 TMemo

controls and streaming the Lines property works as expected.


Am I missing something or might there be a problem here?  Thanks.





C





Powered by ABC Amber Outlook Express Converter