View Issue Details

IDProjectCategoryView StatusLast Update
0015815LazarusLCLpublic2010-08-04 12:31
ReporterTsvetoslavAssigned ToVincent Snijders 
PrioritynormalSeverityminorReproducibilitysometimes
Status closedResolutionfixed 
Platformi386OSwindowsOS VersionWinXP
Product Version0.9.29 (SVN)Product Build23742 
Target VersionFixed in Version0.9.29 (SVN) 
Summary0015815: Range Check Error on right button mouse click
DescriptionSometimes, when I right-click on a control (e.g. TStringGrid), the message "Range Check Error" appears and after I close the error message box all menus stop working - i.e. neither the main menu reacts to mouse clicking, nor any popup menu can be shown. The other controls (buttons, edit boxes, etc.) seems to work.
This happened with some of my applications, but today the error appeared when I right-click in Lazarus IDE - source editor form and I had to restart the program.
Steps To ReproduceSorry, this seems to happen rarely and randomly. If I find a way to reproduce the bug, I'll upload a sample project.
TagsNo tags attached.
Fixed in Revision23890
LazTarget-
WidgetsetWin32/Win64
Attached Files

Activities

samuel herzog

2010-02-27 13:30

developer   ~0034827

Could not reproduce this problem with version SVN23799.
Please attach an example project to demonstrate the problem.

Tsvetoslav

2010-03-02 11:25

reporter   ~0034899

I could not reproduce the error using current SVN version (23821), too. Hopefully, it is fixed meanwhile, so you can close this issue.

Tsvetoslav

2010-03-05 14:37

reporter   ~0034951

OK, I found what the problem was... When Lazarus is compiled with "MSG_DEBUG" defined, the following code in win32callback.inc (line 1426):
  {$IFDEF MSG_DEBUG}
  with PDrawItemStruct(LParam)^ do
    debugln(format('Received WM_DRAWITEM type %d handle %x', [ctlType, hwndItem]));
  {$ENDIF}
sometimes raises "range check error" exception, namely when hwndItem (which is LongWord) is greater than MaxInt ($7FFFFFFF), e.g. $BA231436.
As it is known issue with FPC (0015725 http://bugs.freepascal.org/view.php?id=15727 ), I would suggest to locally turn off range checking, so that the code can become:
  {$IFDEF MSG_DEBUG}
  {$R-}
  with PDrawItemStruct(LParam)^ do
    debugln(format('Received WM_DRAWITEM type %d handle %x', [ctlType, hwndItem]));
  {$R+}
  {$ENDIF}

Tsvetoslav

2010-08-04 12:31

reporter   ~0039975

Thanks, seems OK now.

Issue History

Date Modified Username Field Change
2010-02-19 15:45 Tsvetoslav New Issue
2010-02-19 15:45 Tsvetoslav Widgetset => Win32/Win64
2010-02-27 13:30 samuel herzog Note Added: 0034827
2010-03-02 11:25 Tsvetoslav Note Added: 0034899
2010-03-02 12:24 Vincent Snijders LazTarget => -
2010-03-02 12:24 Vincent Snijders Status new => resolved
2010-03-02 12:24 Vincent Snijders Resolution open => fixed
2010-03-02 12:24 Vincent Snijders Assigned To => Vincent Snijders
2010-03-05 14:37 Tsvetoslav Status resolved => assigned
2010-03-05 14:37 Tsvetoslav Resolution fixed => reopened
2010-03-05 14:37 Tsvetoslav Note Added: 0034951
2010-03-09 16:30 Vincent Snijders Fixed in Revision => 23890
2010-03-09 16:30 Vincent Snijders Status assigned => resolved
2010-03-09 16:30 Vincent Snijders Fixed in Version => 0.9.29 (SVN)
2010-03-09 16:30 Vincent Snijders Resolution reopened => fixed
2010-08-04 12:31 Tsvetoslav Status resolved => closed
2010-08-04 12:31 Tsvetoslav Note Added: 0039975