trichview.com

trichview.support




Re: SaveTextToStream do not work....


Return to index


Author

Message

Sergey Tkachenko

Posted: 10/01/2004 19:48:03


1) Call Stream.Position := 0 before reading text from stream

2) Write writes from stream, not reads from it.

If pTextBuf is String, the code should be:


Stream := TMemoryStream.Create;

RichViewEdit.SaveTextToStream('Text', Stream,-1, false, true);

Stream.Position := 0;

SetLength(pTextBuf, Stream.Size);

Stream.ReadBuffer(PChar(pTextBuf)^, Length(pTextBuf));

Stream.Free;



>

> I'm have the code:

>     Stream := TMemoryStream.Create;

>     RichViewEdit.SaveTextToStream('Text', Stream,-1, false, true);

>     Stream.Write(pTextBuf,50);

>     Stream.Free;

> it don't work, pTextBuf is empty... but

> RichViewEdit.SaveText('c:\\TestText.txt', -1); work correct





Powered by ABC Amber Outlook Express Converter