On Fri, Apr 29, 2005 at 01:23:15PM -0000, Dr. Vesselin Bontchev wrote:

> Since I have to pass several things this way (code indicating what
> kind of alarm it is, volume reference, possibly other things),
> obviously "ref" must be a pointer to a structure. Let me guess - it
> can't be a global structure, right? So, I'll have to allocate this
> structure when setting the alarm and free it when the alarm
> triggers. Can I rely that the memory allocated for this structure will
> remain available between setting the alarm and its triggering? Or do I
> have to do stupid tricks like setting the owner of that memory to
> zero?

Store the data in a feature.

> OK, so I'll copy start.prc to the main memory using
> VFSImportDatabaseFromFile. But how do I run it afterwards? With
> SysUIAppSwitch or with SysAppLaunch? The documentation suggests that
> SysUIAppSwitch is used when switching to another application from your
> normal (i.e., with user interface) application - because it posts
> appStopEven that your application is supposed to catch and quit. But
> I'll be launching start.prc from an alarm. I won't be in an event loop
> at this point. 

Your alarm handler won't be in an event loop, but the application that
is running when your alarm triggers is still running and still needs an
appStopEvent. So, use SysUIAppSwitch.

> What should I pass as the cmdPBP argument? NULL?

Yes.

> When the volume is unmounted, I should delete start.prc from the main
> memory. How do I do that? There are two problems.

You should watch for the app quitting (it's a notification), and only delete
the app on volume unmount after you've noticed that the app has quit.

> How do I *find* the start.prc in the main memory anyway? I probably
> cannot expect its LocalID at the time when I have copied it there to
> remain the same - what if meanwhile other databases have been created?

Use the database name; it's unique to the device.

-- 
Dave Carrigan
Seattle, WA, USA
[EMAIL PROTECTED] | http://www.rudedog.org/ | ICQ:161669680
UNIX-Apache-Perl-Linux-Firewalls-LDAP-C-C++-DNS-PalmOS-PostgreSQL-MySQL

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

Reply via email to