trichview.com

trichview.support




Re: SaveToStream and LoadFromStream has no function?


Return to index


Author

Message

Cai Song

Posted: 09/09/2003 15:48:47


I got it!

Need to set stream position.


> I have tried SaveR*FToStream and LoadR*VFromStream, but they did nothing.

> Please help.

>

> <<Below is source>>

>

> unit Unit1;

>

> interface

>

> uses

>   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls,

Forms,

>   Dialogs, StdCtrls, RVStyle, RVScroll, RichView, RVEdit;

>

> type

>   TForm1 = class(TForm)

>     RichViewEdit1: TRichViewEdit;

>     RVStyle1: TRVStyle;

>     Button1: TButton;

>     Button2: TButton;

>     procedure FormCreate(Sender: TObject);

>     procedure FormDestroy(Sender: TObject);

>     procedure Button1Click(Sender: TObject);

>     procedure Button2Click(Sender: TObject);

>   private

>     stream: TStream;

>     { Private declarations }

>   public

>     { Public declarations }

>   end;

>

> var

>   Form1: TForm1;

>

> implementation

>

> {$R *.dfm}

>

> procedure TForm1.FormCreate(Sender: TObject);

> begin

>   stream := TMemoryStream.Create;

> end;

>

> procedure TForm1.FormDestroy(Sender: TObject);

> begin

>   stream.Free;

> end;

>

> procedure TForm1.Button1Click(Sender: TObject);

> begin

>   richviewedit1.SaveRVFToStream(stream,false);

> end;

>

> procedure TForm1.Button2Click(Sender: TObject);

> begin

>   richviewedit1.LoadRVFFromStream(stream);

>   richviewEdit1.Format;

> end;

>

> end.

>

>





Powered by ABC Amber Outlook Express Converter