Win32Lib doEvents() BUG

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

There is a bug in Win32Lib doEvents (0).
If you run this program below and close it exw.exe will still be running if
you look in task manager.




include win32lib.ew

integer Main_window

procedure on_main_window_activate ()
    integer i
    i = 1
    while 1 do
        doEvents (0)
        setText (Main_window, sprintf ("%d", i))
        i += 1
    end while
end procedure

Main_window = create (Window, "doEvents(0) Bug", 0, Default, Default,
Default, Default, 0)
onActivate [Main_window] = routine_id ("on_main_window_activate")

WinMain (Main_window, Normal)






You can fix it if you add this to your program:

constant xExitProcess=registerw32Procedure(kernel32,"ExitProcess",{C_INT})

procedure on_main_window_close ()
    w32Proc(xExitProcess,{0})
end procedure

onClose [Main_window] = routine_id ("on_main_window_close")

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

Search



Quick Links

User menu

Not signed in.

Misc Menu