trichview.com

trichview.support




Problem streaming checkpoint to DB


Return to index


Author

Message

Mitch Tracy

Posted: 07/13/2005 6:29:07


Hi,




Have upgraded to version 1.9.14.1 from version 1.7. One issue has arisen.  I

am having trouble streaming documents back to my database that have

checkpoints in them.




Using the very nice editor as a basis for tRichView my app, I create the

checkpoint with this code:





procedure TfrmRvDbEdit.InsertSoftPageBreak1Click(Sender: TObject);


var


  iCheckPointNo : Integer;


  CheckpointData: TCheckpointData;


begin


  if NOT DropCheckpoint then Exit; // remove the checkpoint if it already

exists


  with RichViewEdit1 do


    try


      SetCheckpointInfoEd(CurItemNo, 999, k_SoftBreak, False); //

k_SoftBreak = 'SoftPageBreak';


    except


      on E:Exception do


        MessageDlg(E.Message + ' Error placing soft page break'


                  ,mtError


                  ,[mbOk], 0);


    end;


end;




When the editing is finished, I stream the document back to the database

like this:




In version 1.7, all was well.  Sadly, the new version throws an error in

this function  when I try to stream the document back to the database.




function RVFSaveTag(TagsArePChars:Boolean; Tag: Integer): String;


begin


  if TagsArePChars then


    if (Tag=0) or (PChar(Tag)[0]=#0) then  // ç error occurs right here

because the value 'Tag' is null


      Result := RVFTagEmptyStr


    else


     {$IFDEF RICHVIEWCBDEF3}


      Result := AnsiQuotedStr(PChar(Tag), '"')


     {$ELSE}


     Result := PChar(Tag)


     {$ENDIF}


  else


    Result := IntToStr(Tag)


end;




Here's the call stack.  The bottom two items are mine, the rest is RichView




RVFSaveTag(???,0)


RVFWriteCheckpoint($2E0A7A0,True,nil)


RVFWritePrevStrings(1)


TCustomRVData.SaveRVFToStreamEx($2E0A7A0,rvfss_Full,536870911,$2E18C70,$2E09384)


TCustomRVData.SaveRVFToStream(???,???,536870911,$2E18C70,$2E09384)


TCustomRichView.SaveRVFToStream($2E0A7A0,False)


TfrmDBDocuments.Edit1Click(???)


TfrmMain.Documents2Click(???)




Here is my actual calling code:




      try


        try


          Stream := TMemoryStream.Create;


          if bSetEdit then ADOTbl.Edit;


          RichViewEdit1.SaveRVFToStream(Stream, False); ç calling

SaveRVFToStream




So, what am I doing wrong?  The checkpoint reads into the editor fine, just

getting it out and back to the database is the problem






So, what am I doing wrong?  The checkpoint reads into the editor fine, just

getting it out is the problem




Many Thanks,




-          Mitch











Powered by ABC Amber Outlook Express Converter