Page 1 of 1

AppendRVFFromStream/InsertRVFFromStream can't work

Posted: Tue Mar 01, 2011 5:04 pm
by noibird
Hi,
I have one richview(rv) and one richviewedit(rve), I want to copy content from richviewedit to richview. I code like this:

Code: Select all

TMemoryStream	*stream = new TMemoryStream();
rve->SaveRTFToStream(stream, false);
stream->Position = 0;
rv->InsertRVFFromStream(stream, rve->ItemCount); // or rv->AppendRVFFromStream(stream,-1);
Neither InsertRVFFromStream nor InsertRVFFromStream can't get any content in richview. So my question is how to copy content from richviewedit to richview?(include gif image)

Any help is appreciate!

Posted: Tue Mar 01, 2011 7:21 pm
by Sergey Tkachenko
Call rv->Format() at the end.

Posted: Wed Mar 02, 2011 1:34 am
by noibird
sorry, it's my mistake, I have added rv->Format() at the end. But richview didn't display anything.
Is there some parameters I need to setup?

Posted: Wed Mar 02, 2011 4:45 pm
by noibird
I've fixed the problem. Change rve->SaveRTFToStream to rve->SaveRVFToStream...My mistake.

Thank you very much!