Tony Cheung wrote:
Hi Eric,
Eric Blanpied wrote:
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.
That's a good question. I think you could look at PalmOS system header, NotifyMgr.h and try to declare your own type without collision with the system defined ones. I am not sure if PalmSource has reserved a range for user-defined ones.
Does anyone have a better idea on this problem?
On second thought, you may notice that all defined types in NotifyMgr.h use all lower-case letters. I think all lower-case letters of notify types are system reserved. So you may want to use mixed-case or all upper case for user-defined notify types, such as
#define myDeferredNotifyEvent 'USR1'
Tony
-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
