[lazarus] Bug in Win32 code

Martin Smat martin.smat at tiscali.cz
Sun Nov 17 09:38:05 EST 2002

   there is a serious bug in Windows specific code. This is in file
win32proc.inc. The result value in function ObjectToHwnd(...) is in some
cases uninitialized (for example when using toolbarbuttons - AObject is
TWinControl but AObject.HandleAllocated returns False), which often
causes Windows crashing. Now I´m able to run toolbar example without 
crashing Windows. Please apply the attached patchfile for fixing

   And now one question. Does anybody know how to create a handle for
toolbarbuttons in Win32 API?
The handle is IMO needed because of endless loop when handle = 0 (but 
I´m not 100% sure).

   Martin Smat.

>   Handle := 0;
<     Handle := 0;
<   If handle = 0 Then
>   If Handle = 0 Then

More information about the Lazarus mailing list