1. Derek, CChris: Question about Win32lib's AppCleanUp
- Posted by Judith Evans <camping at ccewb.net> May 08, 2007
- 688 views
- Last edited May 09, 2007
I'm trying to find a way to close IDE after Win32lib displays a fatal error message while running the IDE generated exw. But what I am trying doesn't work. But I obviously do not know what to do.
function AppCleanUp(integer ErrCode, sequence ErrText, integer ControlId, integer LastCleanUp) if ErrCode then VOID=message_box("closing IDE due to Winlib fatal error","",0) VOID=invokeHandler(Controls, w32HClose,{}) end if return 0 -- Continue with other clean up routines. end function -- Link in clean-up routine VOID = attachCleanUp( routine_id("AppCleanUp" ))
2. Re: Derek, CChris: Question about Win32lib's AppCleanUp
- Posted by Derek Parnell <ddparnell at bigpond.com> May 09, 2007
- 684 views
Judith Evans wrote: How does this work .. ?
function AppCleanUp(integer ErrCode, sequence ErrText, integer ControlId, integer LastCleanUp) if ErrCode then VOID=message_box("closing IDE due to Winlib fatal error","",0) closeApp() end if return 0 -- Continue with other clean up routines. end function -- Link in clean-up routine VOID = attachCleanUp( routine_id("AppCleanUp" ))
-- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell
3. Re: Derek, CChris: Question about Win32lib's AppCleanUp
- Posted by Judith Evans <camping at ccewb.net> May 09, 2007
- 689 views
Derek Parnell wrote: > > Judith Evans wrote: > > How does this work .. ? > }}} <eucode> > function AppCleanUp(integer ErrCode, sequence ErrText, integer ControlId, > integer LastCleanUp) > if ErrCode then > VOID=message_box("closing IDE due to Winlib fatal error","",0) > closeApp() > end if > return 0 -- Continue with other clean up routines. > end function > > -- Link in clean-up routine > VOID = attachCleanUp( routine_id("AppCleanUp" )) > </eucode> {{{ > > > -- > Derek Parnell > Melbourne, Australia > Skype name: derek.j.parnell Here is a little exw that demonstrates what is happening. WS_CHILD style is used without a Parent id supplied in the createEx statement. After the Win32lib Fatal Error is shown a few seconds later Windows[tm] XP wants to shut down. Even when clicking Cancel in the shut down options, all open applications are shut down. I have to recycle my machine to get everything working again normally.
include win32lib.ew without warning constant Window1=createEx(Window,"",0,0,0,400,300,0,0), Child2=createEx(Window,"",0,20,20,100,100,or_all(WS_CHILD),0) function AppCleanUp(integer ErrCode, sequence ErrText, integer ControlId, integer LastCleanUp) if ErrCode then VOID=message_box("closing due to Winlib fatal error","",0) closeApp() end if return 0 -- Continue with other clean up routines. end function -- Link in clean-up routine VOID = attachCleanUp( routine_id("AppCleanUp" )) WinMain(Window1,Normal)
It may be that the 'damage' is already done before AppCleanUp.