Re: Derek, CChris: Question about Win32lib's AppCleanUp

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

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.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu