RE: 4 Win32lib users
- Posted by jordah ferguson <jorfergie03 at yahoo.com> Sep 04, 2002
- 409 views
Derek, I just found out that there are already some controls pre-created in win32lib. because when i crushed my program and checked the length of the window_handle. it had extra -1's. This is due to the internal image lists that are made. Derek do you really have to create ImageLists() using NewControl() it is a waste of time and laggs win32lib efficiency. I don't have win32lib to verify i'm right since i'm at an e- cafe. but i'm pretty sure i read this in win32lib some time back!!! Jordah Derek Parnell wrote: > Thank you Jordah, and you are not wrong. > > I'd just like to also mention that the number you enter in > setControlBlocks() does not limit the > application to this many controls, it is just the amount that it > pre-allocates. If it needs more it > adds control blocks in increments of 10. > > --------- > Derek. > > 2/09/2002 11:22:25 PM, jordah ferguson <jorfergie03 at yahoo.com> wrote: > > > > >Dear Win32lib Users, > > > > Here is a tip for those coding win32lib programs with many controls etc > >I just decided to read through win32lib and guess what proc i got. > >setControlBlocks(integer pQty) > >-- The above function is such a time-saver especially for programs with > >many controls > >-- because it pre-allocates space in memory to handle & manage only > >controls created > >-- For example if you see you program has about 64 Controls. > >-- then call this function specifying pQty as 64. > > > >The above, can boost up the speed of your win32 program immensely. For > >those whose > >programs contain eg 1 control then set pQty as 1. Win32lib by default > >uses > >16. meaning it will allocate Space for 15 other controls and always has > >to loop > >throught them making the event handling less efficient etc. > > > >So to get better event-handling performance, call this function before > >creating any > >control. eg in the below example the event queue contains 1 control > >other than > >16, where one is valid and the others would have to be checked first > >for validity > >then ignored > > > >include win32lib.ew > >setControlBlocks(1) > >constant SimpleWin = create( Window, "Simple Window", 0, 0, 0, 200, > >100, 0 ) > >WinMain( SimpleWin, Normal) > > > >--* Derek, Thanx alot for this routine and Correct me if i'm wrong > > > >Jordah Ferguson > > > > > --------- > Cheers, > Derek Parnell > ICQ# 7647806 > >