View Issue Details

IDProjectCategoryView StatusLast Update
0016088LazarusLCLpublic2010-12-09 10:14
ReporterTsvetoslavAssigned ToVincent Snijders 
PrioritynormalSeverityminorReproducibilitysometimes
Status closedResolutionfixed 
Platformi386OSwindowsOS VersionWinXP
Product Version0.9.29 (SVN)Product Build 
Target Version1.0.0Fixed in Version0.9.29 (SVN) 
Summary0016088: Range Check Error in CreatePatternBrush in winapi.inc
DescriptionI installed VirtualTreeView package (https://lazarus-ccr.svn.sourceforge.net/svnroot/lazarus-ccr/components/virtualtreeview-new) and tried to run the demo applications. In most cases I received "Range Check Error" exception in CreatePatternBrush function in winapi.inc, more exactly on the line
   LogBrush.lbHatch := ABitmap
It seems the problem is that lbHatch is PtrInt type (i.e. Longint with 32-bit applcations), while ABitmap is of type THandle, i.e. DWord (LongWord) and sometimes the assignment causes Range Check Error.
So, either lbHatch should be defined as PtrUInt in tagLOGBRUSH record definition, e.g.
   tagLOGBRUSH = record
     lbStyle: LongWord;
     lbColor: TColorRef;
     lbHatch: PtrUInt;
   end;
or an implicit type cast should be used wherever there is such an assignment, e.g.
   LogBrush.lbHatch := PtrInt(ABitmap);

TagsNo tags attached.
Fixed in Revision28637
LazTarget1.0
WidgetsetWin32/Win64
Attached Files

Relationships

has duplicate 0018159 closedVincent Snijders Patches Range check error in CreatePatternBrush 

Activities

Tsvetoslav

2010-03-24 13:02

reporter   ~0036025

Well, I meant "explicit type cast", not "implicit type cast". :)
   LogBrush.lbHatch := PtrInt(ABitmap);

Vincent Snijders

2010-12-06 14:30

manager   ~0044042

Thanks for pointing out the relation with issue 18159.

Tsvetoslav

2010-12-09 10:14

reporter   ~0044116

Seems OK now, thanks.

Issue History

Date Modified Username Field Change
2010-03-23 12:32 Tsvetoslav New Issue
2010-03-23 12:32 Tsvetoslav Widgetset => Win32/Win64
2010-03-24 13:02 Tsvetoslav Note Added: 0036025
2010-10-29 15:42 Vincent Snijders LazTarget => 1.0
2010-10-29 15:42 Vincent Snijders Status new => acknowledged
2010-10-29 15:42 Vincent Snijders Target Version => 1.0.0
2010-12-06 09:44 Vincent Snijders Relationship added has duplicate 0018159
2010-12-06 14:30 Vincent Snijders Fixed in Revision => 28606
2010-12-06 14:30 Vincent Snijders Status acknowledged => resolved
2010-12-06 14:30 Vincent Snijders Fixed in Version => 0.9.29 (SVN)
2010-12-06 14:30 Vincent Snijders Resolution open => fixed
2010-12-06 14:30 Vincent Snijders Assigned To => Vincent Snijders
2010-12-06 14:30 Vincent Snijders Note Added: 0044042
2010-12-06 21:06 Vincent Snijders Fixed in Revision 28606 => 286
2010-12-06 21:06 Vincent Snijders Fixed in Revision 286 => 28637
2010-12-09 10:14 Tsvetoslav Status resolved => closed
2010-12-09 10:14 Tsvetoslav Note Added: 0044116