But what I want to do is to keep the callback running when I switch to another app. Upto a point it seems to work, but whenever I try to switch to another app I always get an immediate soft reset. Clearly, I'm either trying to do something the Palm OS cannot do, or I'm trying to do something that should work, but my code is screwing up. I suspect the latter.
The key thing you need to do is keep the code that the callback calls from moving. The normal way to do this is to make sure the code resource that holds your code is locked and the database with the resource is protected. If you don't, the OS could move the code around in memory, invalidating the callback routine's location.
Of course, when your application isn't the current UI application, your callback won't have access to any global variables or code in other segments, so you need to make sure all the context it needs is available. Effective segmentation can help a lot.
-- Ben Combee, senior DTS engineer, PalmSource, Inc. Read "Combee on Palm OS" at http://palmos.combee.net/
-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
