1. Win32Lib Bug Fix
- Posted by David Cuny <dcuny at LANSET.COM> Dec 20, 1998
- 323 views
Mike Fowler helped identify a serious bug that's been in Win32Lib for some time. The fix will be in the next release, but I thought I should post it immediately. The error is in the function create(); the corrected code is: -- create control window_handle[id] = c_func( xCreateWindow, { 0, -- extended style buffer1, -- window class name buffer2, -- window caption styleFlags, -- window style x, -- initial x position y, -- initial y position xSize, -- initial x size ySize, -- initial y size -- NEW! 0.15b used to be myHwnd getHandle( owner ), -- parent window handle NULL, -- window menu handle 0, -- program instance handle NULL} ) -- creation parameters The 'getHandle( owner )' correctly assigns the owner's handle to the control; the old 'myHwnd' value assigned the handle of the last active control/window, and hasn't worked correctly since the addition of multiple windows. This fix takes care of some really obscure bugs, like not being able to create any scroll bars after calling setScrollRange. I'm hoping that it takes care of the weird memory errors, but I'm not holding my breath... Thanks, and sorry for the inconvenience. -- David Cuny