trichview.com

trichview.support




Re: Send formated text from a RichViewEdit to a String ???


Return to index


Author

Message

Souch

Posted: 01/03/2004 1:20:36


Argh,


another probleme with Stream : it totaly remplace the dest :(



. . .



"Sergey Tkachenko" <svt@trichview.com> a écrit dans le message de news:

3ff561f9@support.torry.net...

> Copying via stream:

>

> // init

> Stream := TMemoryStream.Create;

> // saving

> rvsource.SaveRVFToStream(Stream, False);

> // loading

> Stream.Position := 0;

> rvdest.LoadRVFFromStream(Stream);

> rvdest.Format;

> // done

> Stream.Free;

>

>

> The same via String:

>

> // saving

> Stream := TMemoryStream.Create;

> rvsource.SaveRVFToStream(Stream, False);

> SetLength(str, Stream.Size);

> Stream.Position := 0;

> Stream.ReadBuffer(PChar(str)^, Length(str));

> Stream.Free;

>

> // loading

> Stream := TMemoryStream.Create;

> Stream.WriteBuffer(PChar(str)^, Length(str));

> Stream.Position := 0;

> rvdest.LoadRVFFromStream(Stream);

> rvdest.Format;

> Stream.Free;

>

> Warning: this string will contain some binary data, so it cannot be

> saved/loaded in text files.

>

> PS: Happy New Year

>

> >

> > Hi ! for a mini chat project i try to integrate formated txt (in RVT

> format

> > bya exemple) in a string, for put it in a another RichView (for a chat

> dialogue

> > with formating text,color,size options ...)

> >

> > Thanks !! And Happy New Year to all :)

> >

> > ps : sorry for my realy poor english ... :|

> >

>

>





Powered by ABC Amber Outlook Express Converter