Jump to content
Ian Branch

Range check error...

Recommended Posts

Hi Team,

D12.3, 64-bit App.

An Application is reporting this issue:   

Range check error at (0000000001B5E842{DBiWorkflow.exe}) [00000000027FE842] ad3WinAPIParser.TWinAPIControlParser.GetSelectionScreenPosition (Line 510, "ad3WinAPIParser.pas") + $44.

Line 510 is:  NextLinePos := SendMessage(FHandle, EM_LINEINDEX, FY + 1, 0);

FY is a LongInt.

The PC it is being generated on is a Windows 10 64-bit PC.  Screen resolution is 1600 x 900.

I have had a look at m$oft's EM_LINEINDEX but I am non the wiser.

It doesn't happen all the time.

Any thoughts/suggestions appreciated.

 

Regards & TIA,

Ian

Share this post


Link to post

"FY" is longint (signed 32 bit) and the parameter of SendMessage (WPARAM) is nativeint (signed 64 bit). nativeuint (unsigned 64 bit)

 

May be with the internal conversion (32 -> 64) and + 1 sometimes something wrong occurs. It's the case when FY = -1 ?

 

As workaround try to define FY as INT64. UINT64.

 

It's something that needs more accurate investigation ...

 

EDIT: correct thanks to PeaShotter

Edited by DelphiUdIT

Share this post


Link to post
3 hours ago, Ian Branch said:

m$oft

Seeing this removed all my interest in helping. You don't have a clue what you are doing so blame Microsoft rather than yourself. 

Share this post


Link to post
16 minutes ago, David Heffernan said:

Seeing this removed all my interest in helping. You don't have a clue what you are doing so blame Microsoft rather than yourself. 

A little rude but...There was no blame assigned to anywhere except myself for not understanding.

  • Like 2

Share this post


Link to post
32 minutes ago, DelphiUdIT said:

As workaround try to define FY as INT64.

Hmm.  I see where you are coming from but there multiple cases sof LongInt variables in multiple Units that will need to be changed.

I will give it some thought.

Hmmm.  If I going that far, perhaps I could use NativeInt...

Share this post


Link to post

SendMessage expects certain parameter types and returns a specific type. Have a look at those and use accordingly. Do Type Casting where needed. You can also log the value of FY when the issue occurs.

Edited by PeaShooter_OMO

Share this post


Link to post
3 minutes ago, PeaShooter_OMO said:

You can also log the value of FY when the issue occurs.

I have done this as a starting point.  I will have to wait for the Customer to have/experience the issue so I get the Error Report & Log.

Share this post


Link to post
3 hours ago, Ian Branch said:

Hmm.  I see where you are coming from but there multiple cases sof LongInt variables in multiple Units that will need to be changed.

I will give it some thought.

Hmmm.  If I going that far, perhaps I could use NativeInt...

Like @PeaShooter_OMO said, the parameter WPARAM is UINT64. So longint (signed 32 bit) and "unisgned 64 bit" are not a good combination.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×