Accessviolation editng a merged RVF

General TRichView support forum. Please post your questions here
Post Reply
jimmaguire
Posts: 206
Joined: Thu Sep 15, 2005 1:41 am
Location: California

Accessviolation editng a merged RVF

Post 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!
Attachments
EurekaLogCallStack.png
EurekaLogCallStack.png (181.29 KiB) Viewed 10590 times
BeforeMerge.rvf
(100.96 KiB) Downloaded 911 times
AfterMerge.rvf
(53.85 KiB) Downloaded 913 times
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Accessviolation editng a merged RVF

Post 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.
jimmaguire
Posts: 206
Joined: Thu Sep 15, 2005 1:41 am
Location: California

Re: Accessviolation editng a merged RVF

Post 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.
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Accessviolation editng a merged RVF

Post by Sergey Tkachenko »

I answered in a private message
jimmaguire
Posts: 206
Joined: Thu Sep 15, 2005 1:41 am
Location: California

Re: Accessviolation editng a merged RVF

Post 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
Attachments
FSRJobWalkVRLA.zip
(41.62 KiB) Downloaded 955 times
RVTableInDebugger2.zip
(225.56 KiB) Downloaded 953 times
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Accessviolation editng a merged RVF

Post 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)
jimmaguire
Posts: 206
Joined: Thu Sep 15, 2005 1:41 am
Location: California

Re: Accessviolation editng a merged RVF

Post by jimmaguire »

That worked! Thanks! :D
jimmaguire
Posts: 206
Joined: Thu Sep 15, 2005 1:41 am
Location: California

Re: Accessviolation editng a merged RVF

Post 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;
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Accessviolation editng a merged RVF

Post 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.
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Accessviolation editng a merged RVF

Post by Sergey Tkachenko »

Fixed in TRichView 20.2
Post Reply