1. Win32Lib doEvents() BUG
- Posted by tone.skoda at siol.net Jun 01, 2002
- 392 views
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")
2. Re: Win32Lib doEvents() BUG
- Posted by Derek Parnell <ddparnell at bigpond.com> Jun 02, 2002
- 381 views
Thanks Tone. This is a marginal bug in that one shouldn't really be closing a program while a part of it is still running (the infinite loop). Anyhow, I've "fixed" the library now so that it calls ExitProcess as the last thing when the main window is closed. ------------ Derek. ----- Original Message ----- From: <tone.skoda at siol.net> To: "EUforum" <EUforum at topica.com> Subject: Win32Lib doEvents() BUG > > 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") > > > >