trichview.com

trichview.support




Re: SaveRVFToStream


Return to index


Author

Message

Ryan

Posted: 04/16/2004 15:47:12


Hi,

But what if i want to modify the contents at runtime?

What i want to be able to do is get the contents of the richedit, modify

it, send this modified string (it has to be a string) to another control

and then pass it back to the richedit.

I thought the best way to do this was to save the rich edit contents to a

stream, then write the stream to a string buffer for modification.

How can i do this or is there a different way to acheive the same result?


Thanks.


"Mounir Brigui" <[email protected]> wrote:

>Hi Ryan !

>

>A Stream is already a buffer. Try it directly from Stream to rve, without

>using an extra Buffer.

>

>

>"Ryan" <[email protected]> schrieb im Newsbeitrag

>news:[email protected]...

>>

>> Hi,

>> Just trying to copy an RVF stream to a buffer but can't seem to make it

>work.

>> Looks as though i am losing some data when going from the memory stream

to

>> the buffer, just wondering if you know what the problem is or how i can

>achieve

>> this.

>> My code is as follows:

>>

>> procedure TForm1.Button1Click(Sender: TObject);

>> var

>>  Stream : TMemoryStream;

>>  Buffer : PChar;

>> begin

>>   Stream := TMemoryStream.Create;

>>   Stream.Position := 0;

>>   rve.SaveRVFToStream( Stream , false );

>>   Stream.Position := 0;

>>   GetMem( Buffer , Stream.Size );

>>   Stream.ReadBuffer( Buffer^ , Stream.size );

>>   Stream.clear;

>>   Stream.Position := 0;

>>   Stream.WriteBuffer( Buffer^ , length( Buffer ));

>>   rve.Clear;

>>   rve.Format;

>>   rve.LoadRVFFromStream(Stream);

>>   rve.Format;

>>   Stream.free;

>>   FreeMem( Buffer );

>> end;

>>

>> Thanks.

>

>





Powered by ABC Amber Outlook Express Converter