Re: [ANN] win32lib update - call for testers
- Posted by Bob Thompson <rthompson at rthompson.karo?.co.u?> Oct 30, 2007
- 700 views
> Strange, as I can run your test file with n=10000000 without a crash... I'll > check this further, but there is hardly a clue abou the origin of he problem. > Emailing you the whole distribution, it may help. > > CChris OK, the original demo still crashes with 70.2. However, I think the problem lies with setIndex(edit, {1, 0}). If I replace this with setIndex(edit, {1, length(buffer) +1}) it works fine. Modified test programme below; Regards, Bob include Win32lib.ew without warning constant win = createEx(Window, "Demo", 0, 20, 20, 400, 280, 0, 0) constant edit = createEx(RichEdit, "", win, 0, 0, w32Edge, w32Edge, 0, 0) constant Menu_Edit = createEx(Menu, "Menu", win, 0, 1, 0, 0, 0, 0) constant MenuItem_Cut = createEx(MenuItem, "Cu&t", Menu_Edit, 0, 2, 0, 0, 0, 0) constant MenuItem_Paste = createEx(MenuItem, "&Paste", Menu_Edit, 0, 3, 0, 0, 0, 0) constant MenuItem_Delete = createEx(MenuItem, "&Delete", Menu_Edit, 0, 4, 0, 0, 0, 0) constant MenuItem_Select_All = createEx(MenuItem, "Select&All", Menu_Edit, 0, 5, 0, 0, 0, 0) --=================================== sequence buffer --=================================== --Cut procedure Cut(atom self, atom event, sequence params) cut(edit) end procedure setHandler(MenuItem_Cut, w32HClick, routine_id("Cut")) --=================================== --Paste procedure Paste(atom self, atom event, sequence params) paste(edit) end procedure setHandler(MenuItem_Paste, w32HClick, routine_id("Paste")) --=================================== --Delete procedure Delete(atom self, atom event, sequence params) clear(edit) end procedure setHandler(MenuItem_Delete, w32HClick, routine_id("Delete")) --=================================== --Select All procedure Select_All(atom self, atom event, sequence params) --setIndex(edit, {1, 0})--crashes setIndex(edit, {1, length(buffer) +1})--OK end procedure setHandler(MenuItem_Select_All, w32HClick, routine_id("Select_All")) --=================================== constant n = 5000000 buffer = repeat('a', n) & repeat('z', n) setText(edit, buffer) WinMain(win, Normal)