Zakai, 

You can't call longjmp in the launched application, the state being
restored applies to the program that launched it - even if you did
pass across a pointer to the jump buffer you're using. Things like
stack pointers, program counters, register states - that's what gets
stored in your jump buffer - Those things don't apply to the launched
program, they apply to the parent, and throwing your launched program
into the parent's state will either lock up the device, or it'll do
something extremely interesting and *then* lock up the device. It
won't do what you want it to do.

You *might* be able to call longjmp when you return to the parent app,
based on what the child did. Internally in the child, you could use
setjmp to quickly return to its PilotMain when an error occurs, and
perform an error-exit returning a value that the caller can pick up to
trigger the longjmp it's using.

Really, though, it sounds like little more than a good way to
obfuscate your logic, and a great way to introduce hard-to-find bugs
later on. Your time's probably better spent organising things so that
you don't really need setjmp/longjmp at all -- especially across
programs.

Best of luck,
Brandon

On Sat,  5 Feb 2005 19:04:34 -0000, Zakai Hamilton
<[EMAIL PROTECTED]> wrote:
> Can I use longjmp/setjmp between SysAppLaunches?
> 
> If I call setjmp in my application then call another application with 
> SysAppLaunch (with 0 as flags, so nothing special, no globals, new stack and 
> so on) and then call longjmp in the sub-launch to return to the setjmp of the 
> parent app, will this work?
> --
> For information on using the Palm Developer Forums, or to unsubscribe, please 
> see http://www.palmos.com/dev/support/forums/
>

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please 
see http://www.palmos.com/dev/support/forums/

Reply via email to