I agree with Keith, that "Zen of Palm" dictates that you should allow users
to leave your app at any time and return to it where they left off.
However, if you have a requirement that disables all user inputs for leaving
the application from certain forms and if having POSE send random
appStopEvent calls is a major problem, you can add a call to SysGremlins in
your app event loop right after EvtGetEvent. If you are running in gremlins
and it's an appStopEvent, you can do whatever you want. If you want to
allow appStopEvent from certain forms and exclude it from others, just have
a conditional statement that sets event.eType = nilEvent; to keep the
appStopEvent from being processed.
Make sure to only do this in your debug builds :) You should be using
#define ERROR_CHECK_LEVEL ERROR_CHECK_FULL
for your debug builds, and you can just wrap all the SysGremlins checking
code in #ifdef calls so it will check for gremlins on debug builds, and do
normal processing on release builds. Something like (I don't have the exact
syntax):
#ifdef ERROR_CHECK_LEVEL == ERROR_CHECK_FULL
if (SysGremlins(gremlinIsOn,0)
{
if (FrmGetActiveFormID() == A_FORM_USERS_CAN'T_QUIT_FROM)
event.eType = nilEvent;
}
#endif
Cheers,
-DGA
> >We're testing an app with a single Gremlin. Previously, with POSE 3.2
> >and 3.1, the Gremlins will never send an appStopEvent to the
> app, so the
> >app runs forever.
> >
> >However, apperently with POSE 3.3, Gremlins will periodcally send an
> >appStopEvent (around 3000 events). It will then attempt to
> start the app
> >again automatically and keep going.
> >
> >Is there a way to go back to the old behavior (never send
> appStopEvent?)
>
> What you're seeing is an intentional feature of Gremlins in Palm OS
> Emulator 3.3. And, as far as I knew, a beneficial one. After all,
> users can cause your application to exit at any time -- why wouldn't
> you want Gremlins to test that condition?
>
> In short, no there's no way to turn that feature off. But my
> question to you is, why would you want to?
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/