1. treeview bug
- Posted by Tone Skoda <tone.skoda at siol.net> Apr 24, 2001
- 361 views
This is a multi-part message in MIME format. ------=_NextPart_000_0005_01C0CCB1.05F824C0 charset="iso-8859-2" if i create more items in treeview and then delete them all and again create two items it crashes. look at attached example. i tried to debug win32lib but it's hard. this removes bug in this example program but it still crashes in more complicated program (edsgui): In win32lib in fDoTVN_GETDISPINFO (): -- This is called before we get the handle, so if -- we haven't filled it in yet, we'll just grab -- the first one. if not lItem=20 then lItem =3D find(0, tvitem_handle ) =20 -- Start Tone Skoda if lItem =3D 0 then tvitem_handle =3D append (tvitem_handle, 0) lItem =3D length (tvitem_handle) for i =3D length (tvitem_data) to lItem do tvitem_data =3D append (tvitem_data, {0, 0, 0, 0}) end for =20 end if -- End Tone Skoda end if ------=_NextPart_000_0005_01C0CCB1.05F824C0 Content-Type: text/html; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META content=3D"text/html; charset=3Diso-8859-2" = http-equiv=3DContent-Type> <META content=3D"MSHTML 5.00.2614.3401" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=3D#ffffff> <DIV><FONT face=3DArial size=3D2>if i create more items in treeview and = then delete=20 them all and<BR>again create two items it crashes. look at attached=20 example.<BR>i tried to debug win32lib but it's hard.</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial size=3D2>this removes bug in this example = program<BR>but it=20 still crashes in more complicated program (edsgui):</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial size=3D2><BR>In win32lib in fDoTVN_GETDISPINFO=20 ():</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial size=3D2> -- This is called before = we get the=20 handle, so if<BR> -- we haven't filled it in yet, we'll just = grab<BR> -- the first one.<BR> if not lItem=20 <BR> then<BR> lItem =3D = find(0,=20 tvitem_handle )<BR> <BR> = --=20 Start Tone Skoda<BR> if lItem =3D 0=20 then<BR> =20 tvitem_handle =3D append (tvitem_handle,=20 0)<BR> lItem = =3D=20 length=20 (tvitem_handle)<BR> = =20 for i =3D length (tvitem_data) to lItem=20 do<BR> &= nbsp; =20 tvitem_data =3D append (tvitem_data, {0, 0, 0,=20 0})<BR> end=20 for =20 <BR> end=20 if<BR> -- End Tone = Skoda<BR> end=20 ------=_NextPart_000_0005_01C0CCB1.05F824C0--
2. Re: treeview bug
- Posted by Tone Skoda <tone.skoda at siol.net> Apr 24, 2001
- 358 views
This is a multi-part message in MIME format. ------=_NextPart_000_0007_01C0CCB3.11C7E860 boundary="----=_NextPart_001_0008_01C0CCB3.11CF8980" ------=_NextPart_001_0008_01C0CCB3.11CF8980 charset="iso-8859-2" fogot to attach ------=_NextPart_001_0008_01C0CCB3.11CF8980 charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META content=3D"text/html; charset=3Diso-8859-2" = http-equiv=3DContent-Type> <META content=3D"MSHTML 5.00.2614.3401" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=3D#ffffff> <DIV><FONT face=3DArial size=3D2>fogot to = ------=_NextPart_001_0008_01C0CCB3.11CF8980-- ------=_NextPart_000_0007_01C0CCB3.11C7E860 Content-Type: application/octet-stream; name="TVBug.EXW" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="TVBug.EXW" -- bug in treeview without warning include win32lib.ew atom LV, TV object junk with trace integer ok constant=20 Win =3D create( Window, "TreeView bug", 0, Default, Default, 640, 460, 0 = ) =20 TV =3D create( TreeView, "Treeview", Win, 10, 10, 300, --CW_USEDEFAULT, 300, --CW_USEDEFAULT, or_all({TVS_HASLINES, TVS_LINESATROOT, TVS_HASBUTTONS, TVS_SHOWSELALWAYS})) atom mask mask =3D or_all( {LVIF_IMAGE, LVIF_PARAM, LVIF_TEXT}) constant closefolder =3D addIcon( extractIcon( "clsdfold.ico" ) ), openfolder =3D addIcon( extractIcon( "openfold.ico" )) sequence folders, location, lParams, lv folders =3D {} location =3D {} lParams =3D {} =20 ok =3D addTVItem( TV, closefolder, openfolder, "Windows 1", 0 ) ok =3D addTVItem( TV, closefolder, openfolder, "DOS 2", 0 ) ok =3D addTVItem( TV, closefolder, openfolder, "Linux 3", 0 ) ok =3D addTVItem( TV, closefolder, openfolder, "Generic 4", 0 ) --ok =3D message_box("filled","",MB_ICONINFORMATION) -- if you comment this line bug is gone ok =3D deleteItem( TV, -1 ) --ok =3D message_box("deleted","",MB_ICONINFORMATION) ok =3D addTVItem( TV, closefolder, openfolder, "Windows 1", 0 ) trace (1) -- bug here! ok =3D addTVItem( TV, closefolder, openfolder, "DOS 2", 0 ) WinMain( Win, Normal ) ------=_NextPart_000_0007_01C0CCB3.11C7E860--
3. Re: treeview bug
- Posted by Tone Skoda <tone.skoda at siol.net> Apr 28, 2001
- 356 views
Matt, now it crashes even sooner. Now, I don't know if I inserted your patch right. Maybe I can just wait for next release of Win32Lib, where this bug will be fixed? I have some other things to do anyway.