Try something a little simpler.  Either use EvtResetAutoOffTimer to reset
the sleep timer during a critical process and prevent the unit from
sleeping.   Or catch the power off message, do what you need to do to
prepare for power off, then repost the message.  If you defer the message,
just make sure you don't interrupt the power critical message.  If you
intercept this message, you run the risk of completely depleting the
remaining power and causing the unit to hard-reset.

----- Original Message ----- 
From: "Eric Blanpied" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent: Wednesday, September 24, 2003 3:40 PM
Subject: Deferring Sleep


> The app I'm working on needs to defer sleep and do some stuff, so I'm
> following the stuff in the Palm OS Programmer's companion on the
palmsource
> site, and I've run into a few problems. I'm new at this stuff...
>
> My plan is to catch the Sleep Request event, defer sleep & send off my own
> deferred notification, and then to do my stuff when I get my notification.
> Is this the right way to proceed?
>
> So the problems of the moment:
>
> 1. creating my own notification event: how do I define my own type? The
> snippet shows notifyParam.notifyType being assigned as
> "myDeferredNotifyEvent", but it doesn't explain where I define that.
>
> 2. a bit further on, the document explains that one needs to increment the
> deferSleep parameter:
>     ((SleepEventParamType *)notify->notifyDetailsP))->deferSleep++;
> Where am I getting this "notify" from? Is it part of the notify parameter
> struct.
>
>
>
> Thanks
>
> -e
>
>
> -- 
> 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