trichview.com

trichview.support




SaveRVFToStream


Return to index


Author

Message

Ryan

Posted: 04/16/2004 12:22:53


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