trichview.support
SaveRVFToStream |
Author |
Message |
Ryan |
Posted: 09/28/2004 8:22:45 Hi, Just a quick question about SaveRVFToStream. When i use this function it works ok but i seem to be getting a few "stray" characters at the end of the buffer like it has overrun the buffer or something. Not sure if i am doing something stupid in my code or if there is a bug with the SaveRVFToStream function. An example is shown below. procedure TForm1.Button1Click(Sender: TObject); var Stream : TMemoryStream; Buffer : PChar; BufferStr : String; begin RichViewEdit.RVFOptions := RichViewEdit.RVFOptions - [rvfoSaveBinary]; Stream := TMemoryStream.Create; RichViewEdit.SaveRVFToStream( Stream , false ); Stream.Position := 0; GetMem( Buffer , Stream.Size ); Stream.ReadBuffer( Buffer^ , Stream.Size ); BufferStr := Buffer; FreeMem( Buffer ); Stream.free; showmessage( BufferStr ); end; If you notice in the showmessage dialog a couple of characters which appear to be out of range. Any help would be appreciated. Thanks. |
Powered by ABC Amber Outlook Express Converter