Hi,
I think I found a bug that doesn't show up very frequently:
In lcl/widgetset/wsdialogs.pp, TWSCommonDialog class defines CreateHandle
method, which returns a THandle.
Now, wsdialogs doesn't use LCLType, so THandle is a 32 bit integer on 64
bits platform (apart from win64 IIRC)..
In gtk interface this could lead to problems:
TGtkWSCommonDialog.CreateHandle calls CreateHandle of the widgetset,
which returns a 64 bit thandle, and then returns this value as a 32 bit
thandle.
Even if I never noticed problems with opendialogs & friends with lazarus
(gtk) on x86_64 linux, this doesn't mean that
the code is right (maybe that I was lucky and I always had gtk objects
created under 4 gb limit, or maybe that sometimes I had
access violations but I didn't care about it).
I think that problems might actually arise only with gtk (and gtk2?) since
qt and win32 return 0 as common dialogs handles (I don't
know for fpgui, and carbon is 32 bits only IIRC).
So, if I am right, here is a patch that makes wsdialogs use LCLType. It does
the same to all xxxwsdialogs of the various widgetsets.

bye,
Giulio

Attachment: dialog64bitpatch.diff
Description: Binary data

Reply via email to