[Lazarus] Extending TRect breaks Lazarus

Marco van de Voort marcov at stack.nl
Fri Nov 6 17:21:23 CET 2015

On Fri, Nov 06, 2015 at 11:08:29AM -0500, Dmitry Boyarintsev wrote:
> > I haven't investigated deeper yet, but I suspect the heavy use of WITH in
> > interfaces etc is the cause.  (if you assign width and height of a
> > component in a component method in a WITH with a TRECT as argument, then
> > now
> > width and height of the trect are assigned instead of the component's ?
> >
> This is odd. How adding  the method to TRect didn't break much for Delphi?
> (or maybe it did, we just don't know it).

Maybe they were more careful with WITH or had problems and simply fixed
them, always used self. to qualify such cases. I don't routine look at
Delphi source, so I don't know which one.

> I'd think that Delphi /3d party components code also uses a lot of WITHs
> with TRects

Well, not anymore I guess :-) Or there is a flaw in my thinking, but if so,
then I don't see it. I'm currently building fpc with raise tobject.create in
the relevant methods to see if I can quickly identify some locations. 


a#0  0x77055b68 in RaiseException () from C:\WINDOWS\SysWOW64\KernelBase.dll
#1  0x00416039 in fpc_raiseexception (OBJ=0xe11f3c8, ANADDR=0x0,
# AFRAME=0xe11f730) at seh32.inc:93
#2  0x00417cb6 in RECT__SETWIDTH (AVALUE=236058416, this=...) at
# c:/repo/fpc/rtl/win/wininc/func.inc:2414
#3  0x00531d0a in TWIN32WIDGETSET__GETWINDOWSIZE (HANDLE=986038,
# WIDTH=986038, HEIGHT=5,
    this=<error reading variable>) at
#4  0x004f0c0e in GETWINDOWSIZE (HANDLE=986038, WIDTH=986038, HEIGHT=5) at
# C:/repo/lazarus/lcl/include/winapi.inc:564
#5  0x0052ad58 in TWINDOWPROCHELPER__DOMSGSIZE (this=<error reading
# variable>)
    at C:/repo/lazarus/lcl/interfaces/win32/win32callback.inc:1903
#6  0x0052be5b in TWINDOWPROCHELPER__DOWINDOWPROC (this=<error reading
    at C:/repo/lazarus/lcl/interfaces/win32/win32callback.inc:2358
#7  0x0052c767 in WINDOWPROC (WINDOW=986038, MSG=5, WPARAM=0, LPARAM=0)

Maybe for the 3rd party support it is smart to tag them with experimental or
so till this code is really release (as 3.2), so that people at least get
an hint that something is/could be wrong.

More information about the Lazarus mailing list