Re: Win32Lib Bugs

new topic     » goto parent     » topic index » view thread      » older message » newer message

Robert,

I don't think the bug is in the getText() routine. Please look at this
example where no adding of text takes place outside of the onLoad[Win]
procedure. The only thing I changed was to make "seventyseven" (a 12
character string) out of  "seven". Click this item and .... oops! So no
getText() involved here. The bug has to be in getItem, IMHO! If I comment=

that line out too, everything seems to go smooth!

-- from Ex06.exw by David Cuny
-- This opens a window with a populated list in it.

include win32lib.ew

constant
    Win   =3D create(Window, "List +", 0, Default, Default, 160, 110, 0),=

    List1 =3D create(List, "", Win, 10, 10, 120, 60, 0)
--  ^^ create a list-box window.
--    Label1 =3D create(RText, "", Win, 10, 60, 120, 20, 0) -- commented =
out!
--  ^^ create a right-justified text display window.

procedure onLoad_Win()
    -- add these items to the list-box    =

    addItem(List1, "one")
    addItem(List1, "two")
    addItem(List1, "three")
    addItem(List1, "four")
    addItem(List1, "five")
    addItem(List1, "six")
    addItem(List1, "seventyseven")
    setIndex(List1, 0)
-- ** add another line here !!
end procedure

procedure onDoubleClick_List(integer mouseX, integer mouseY)
integer what
sequence item
    what =3D getIndex(List1)
    item =3D getItem(List1, what)
--show_it(where)        -- also commented out, even all of show_it has
gone!
end procedure

onLoad[Win] =3D routine_id("onLoad_Win")
onDoubleClick[List1] =3D routine_id("onDoubleClick_List")

WinMain(Win)
-- end of wasex06.exw

Robert Craigs original message:
>>I've reproduced this bug now on my machine.

With the aid of the WATCOM debugger, I've determined that the
exw.exe heap (malloc/free area) is already corrupt inside the
routine getText() before this call to c_func() is made:

     iLength =3D c_func( xGetWindowTextLength, { hWnd } ) + 1

I clicked the ADD button after typing a 12-character
string. (I'm not sure if the length of the string is really that
important).
I haven't found the place where this corruption actually takes
place. That may take a while. Maybe someone has an idea. It still
could be either a exw bug or a win32lib bug, I can't tell.

Regards,
     Rob Craig
     Rapid Deployment Software
     http://members.aol.com/FilesEu/<<

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu