Win32Lib bug
- Posted by Ad Rienks <Ad_Rienks at COMPUSERVE.COM> Nov 14, 1998
- 646 views
Michael Sabal wrote: >I don't know if this is what's causing the crash, but there is a problem= with the >program ex06.exw shared earlier today. In the show_it() procedure, list1 changes >its state with the setText(..) procedure. This= triggers and onChange event which >calls show_it() looping continuously. I don't understand what you mean; the show_it() procedure is not affectin= g the list. I've rewritten the code so the procedure show_it isn't even necessary. -- Begin code global procedure onChange_List1() -- list item will be shown in the static line. integer what what =3D getIndex(List1) if what >=3D 0 then setText(Label1, getItem(List1, what)) end if end procedure -- onChange_List1 -- End code I can't see an infinite loop here. The onChange[] method can also be rewritten as an onClick, onDoubleClick or onKeyPress method, maybe even a= s an onEvent method. The latter one I haven't tried yet. But in all these cases, the problem keeps coming back. Maybe I can also have a go at tryin= g it without any method affecting the listbox. But, maybe your guess about the allocation of structures is correct. For the moment, that's too difficult for me, and I'll leave it to the real gurus (David, Robert, ?). >Now, by my logic, this problem would cause a memory overflow or infinite= loop and >would thus be easy to track down. However, there is a problem with setText as >reported in the documentation. The list is a sequence (thus in C, a structure). >Because structures are sent to Windows manually, and not by Euphoria with a list >box, there are a few possibilities I can see (but I'm sure they've already been tried): >1. The new structure is not being set on a 4-byte boundary (Windows law)= . >2. The new structure IS being set on a 4-byte boundary that's already occupied. >3. The list structure is exceeding the size of a page (usually 64K) by starting in the >middle of it. >4. The new structure is longer than the allocated space for this structure. >With all the other structures used in Win32Lib, I think they are pretty static (watch >me put my foot in my mouth :)), but to define the contents= of a list box/combo box, >we need a dynamic structure. Does this have anything to do with it? Maybe yes! >Michael J. Sabal >mjs at osa.att.ne.jp >http://home.att.ne.jp/gold/mjs/index.html Regards and thanks, Ad Rienks