trichview.com

trichview.support




Re: Multiple lines in one RVData.SetItemText(i, value)


Return to index


Author

Message

Jim Maguire

Posted: 06/16/2005 18:43:11


Thanks, but that's not it.  Here's an easy way to reproduce the problem:


1. Open the MailMerge2 demo

2. Comment out the

TBlobField(Table1.FieldByName('Data')).SaveToStream(Result);

3. Insert these lines instead:


var str: String;

  ....

  str := 'Insert this text in RVE';

  Result.WriteBuffer(PChar(str)^, Length(str));

  Result.Position := 0;


//TBlobField(Table1.FieldByName('Data')).SaveToStream(Result);


So now the only difference is I'm alway returning the TMemoryStream with the

same string.


"Anderson Wilson" <[email protected]> wrote in message

news:[email protected]...

> Hi Jim,

>

> I believe I found your problem.

>

> You create a Stream containing a string not a RVF file and then you use

> RichView2.InsertRVFFromStream method that EXPECTS an RVF format not a

> string.

>

> I hope this help you

>

> Anderson

>

> extracted from MemoMergeProblem.zip

>

>   StringStream := TStringStream.Create('This is the first line');

>   StringStream.Position := 0;

>   RichEdit1.Lines.LoadFromStream( StringStream); // load stream contents

> into memorich

>

>   Result.LoadFromStream(StringStream);

>

>   //TBlobField(Table1.FieldByName('Data')).SaveToStream(Result);

>   Result.Position := 0;

>   RichView2.Clear;

>   RichView2.InsertRVFFromStream(Result, 0); // inserting will merge

> styles;

>     // RichView1 and RichView2 have the same collections of styles

>

>

>

> Jim Maguire wrote:

>> I run into exactly the same error (Abort) I get in prior posts when I use

>> TMemoryStream as follows in the LoadData of Sample I attached in prior

>> post:

>>

>>   Result := TMemoryStream.Create;

>>

>>   str := 'Insert this text in RVE';

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

>>   Result.Position := 0;

>>

>> I load it into a RichEdit just fine:

>>     RichEdit1.Lines.LoadFromStream( Result );

>>

>> When I use the Paradox TTable and your code:

>> TBlobField(Table1.FieldByName('Data')).SaveToStream(Result), it works

>> fine.

>>

>> If I could get an example of loading a string into a memory stream and

>> then into RichView I could take it from there.

>>

>> Thanks, this is the only problem I'm having with RichView.

>> There is something the Paradox SaveToStream is doing that's different

>> from the TMemoryStream becausethe DB unit's TBlobField.SaveToStream.

>>

>>

>> "Sergey Tkachenko" <[email protected]> wrote in message

>> news:[email protected]...

>>

>>>Do not use TStringStream, it damages binary data.

>>>Use TMemoryStream instead

>>>

>>>

>>

>>





Powered by ABC Amber Outlook Express Converter