Ian Branch 134 Posted yesterday at 04:01 AM 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
DelphiUdIT 218 Posted yesterday at 07:33 AM (edited) "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 yesterday at 11:44 AM by DelphiUdIT Share this post Link to post
David Heffernan 2404 Posted yesterday at 07:46 AM 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
PeaShooter_OMO 34 Posted yesterday at 07:56 AM 23 minutes ago, DelphiUdIT said: (WPARAM) is nativeint (signed 64 bit). Actually WPARAM is Unsigned 1 Share this post Link to post
Ian Branch 134 Posted yesterday at 08:05 AM 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. 2 Share this post Link to post
Ian Branch 134 Posted yesterday at 08:17 AM 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
PeaShooter_OMO 34 Posted yesterday at 08:21 AM (edited) 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 yesterday at 08:21 AM by PeaShooter_OMO Share this post Link to post
Ian Branch 134 Posted yesterday at 08:25 AM 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
DelphiUdIT 218 Posted yesterday at 11:49 AM 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