1. Derek, CChris: Question about Win32lib's AppCleanUp

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" ))


new topic     » topic index » view message » categorize

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

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

new topic     » goto parent     » topic index » view message » categorize

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

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 message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu