Page 1 of 1

Accessviolation editng a merged RVF

Posted: Wed Apr 06, 2022 10:50 pm
by jimmaguire
I can't reproduce this error but several of my customers get it repeatedly. They're trying to edit the merged document, sometimes just typing text, other times deleting table rows. Attached is the RVF before and after the merge. The customer told me they tried to clear and retype the

RVTable.pas RVTable TRVTableItemInfo CreateInplace 11694 102

Thanks for any help!

Re: Accessviolation editng a merged RVF

Posted: Thu Apr 07, 2022 5:46 am
by Sergey Tkachenko
What version of TRichView do you use? It looks like these line numbers do not correspond to the code of TRichView 20.1.

Re: Accessviolation editng a merged RVF

Posted: Thu Apr 07, 2022 6:13 pm
by jimmaguire
I'm using v20.0.2 (2022-01-27), but the RVF file is loaded from our customer's DB and the 2 customers having the most problems have been with us since 2006.

I thought an old rvf could be the issue so I opened and save the file again but it had no effect. I just got off the phone with a customer having the issue and had them downgrade to a year-old version of our app and it worked.

I have no issues running our app and editing the merged docs, just 3 or 4 customers. Some use the Protect feature, so i unprotected and had them try, still failed.

Our RVF templates can be 10 years old or more. Some customers have100 templates.

Re: Accessviolation editng a merged RVF

Posted: Fri Apr 08, 2022 5:58 pm
by Sergey Tkachenko
I answered in a private message

Re: Accessviolation editng a merged RVF

Posted: Mon Apr 11, 2022 9:06 pm
by jimmaguire
I posted this in a private message but not sure it took and want to be sure you get the attachments. I can reproduce the error myself now on an unmerged rvf on my backup pc. See attached.

I use Devexpress spell checker.

I upgraded to 20.1

Re: Accessviolation editng a merged RVF

Posted: Tue Apr 12, 2022 12:30 pm
by Sergey Tkachenko
What's the exceptions exactly?
Is it a range check error?
The problem with GetMessageTime was recently reported by another customer.
The solution is to find all calls of GetMessageTime in TRichView code and typecast them to Cardinal, i.e. this line must be

Code: Select all

tie.FClickTime := {$IFDEF FIREMONKEY}TThread.GetTickCount{$ELSE}Cardinal(GetMessageTime){$ENDIF};
There are other calls of GetMessageTime, they all need to be typecasted (if it is already typecasted to UINT, it's ok)

Re: Accessviolation editng a merged RVF

Posted: Tue Apr 12, 2022 4:54 pm
by jimmaguire
That worked! Thanks! :D

Re: Accessviolation editng a merged RVF

Posted: Fri Apr 15, 2022 4:24 pm
by jimmaguire
Got a range check violation at:

Range check error at (01F9E0B8){WFM.EXE } [0239E0B8] RichView.TCustomRichView.WndProc (Line 6718, "RichView.pas") + $9.

It casts to a UINT: UINT(GetMessageTime)

Should I change UINT to CARDINAL? Delphi 10.3 fails to find GetMessageTime, not sure why, going to use Visual Studio to search for more. It is in RVTInplace as well. Please advise.



procedure TCustomRichView.WndProc(var Message: TMessage);
begin
case Message.msg of
WM_LBUTTONDOWN:
begin
if (FDblClickTime <> 0) and
(UINT(GetMessageTime) - UINT(FDblClickTime) < GetDoubleClickTime) then
begin
SendTripleClickMessage;
exit;
end;
FDblClickTime := 0;
end;
WM_LBUTTONDBLCLK:
begin
FDblClickTime := GetMessageTime;
end;
end;
inherited WndProc(Message);
end;

Re: Accessviolation editng a merged RVF

Posted: Fri Apr 15, 2022 5:01 pm
by Sergey Tkachenko
UINT and Cardinal are the same in Windows platforms.
You can change this line to:

Code: Select all

          (Cardinal(GetMessageTime) - FDblClickTime < GetDoubleClickTime) then
but it should not affect the result.

Do you mean Delphi 10.3 does not display a documentation on GetMessageTime?

Make sure that the modified files are recompiled.
To be completely sure, recompiled TRichView packages.
Run "Install TRichView in Delphi IDE" shortcut in Windows Start menu.

Re: Accessviolation editng a merged RVF

Posted: Tue May 10, 2022 6:12 pm
by Sergey Tkachenko
Fixed in TRichView 20.2