Good questions...

> If I set an alarm using AlmSetAlarm() and then the user deletes the
> application before the alarm is triggered, does the alarm manager handle
> this gracefully?

The docs don't say; they probably should. When your app is deleted, the
system automatically deletes any alarms that were registered by the app. For
this to work, your app must pass its card number and LocalID to
AlmSetAlarm(). There is no card number or LocalID parameter to
AlmSetProcAlarm, so this doesn't apply to procedure alarms.

You don't have much choice, really. You can't, generally speaking, register
to be notified when your app is deleted. So you don't have an opportunity to
unregister your alarms before you're deleted. The exception is if your
database is protected, and only on Palm OS 4.0 and later. Then you can
register to be notified before you're deleted; see
sysNotifyDeleteProtectedEvent. This enables you to unregister your procedure
alarm, unlock your code resource, and unprotect your database, allowing the
delete to proceed without error.

Note that the cleanup must occur when the database is deleted. There is no
way to validate a LocalID.

> If I create a feature using FtrPtrNew() and then the user deletes the
> application, does the feature manager clean up the feature automatically?

This question's been asked before, but I don't see any answers:

  http://www.escribe.com/computing/pcpqa/m22746.html

The docs don't say one way or the other. I would have thought the answer was
"yes", both for regular features and for feature pointers, but I don't see
this in the code. It's probably worth doing some experiments with various
versions of Palm OS to confirm this behavior. Of course both features and
feature pointers are deleted on reset.

Again, generally speaking, you don't have an opportunity to delete your
features before you're deleted, so you don't have much choice.
--
Danny @ PalmSource

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

Reply via email to