Hi All,
I was having a problem with sysAppLaunchCmdAttention (received from Attention Manager). I would like to know if my application is active and if my global variables are available, when that launch code is received.
I like to check for the presence of the sysAppLaunchFlagSubCall bit in the launch code flags. If it's set, then your PilotMain() is being called as a subroutine -- 'subcalled' -- and this implies that your applicaiton is already running as the current application, and thus your global g_DatabaseHandle will still be valid.
If it is cleared, however, such globals do not exist.
To work with your database, Tony, you have a few options as I see it.
1) Go ahead and open it for read access in your sysAppLaunchCmdAttention handler. As long as you open it for non-exclusive read-only, and use DmQueryRecord() to get at its data chunks, it shouldn't matter if you might also already have it opened in write mode. I think... haven't tried this personally, but It Should Work. :)
2) Set and get your database handle using the Feature Manager -- this is the best solution, IMHO. See http://www.palmos.com/dev/support/docs/palmos/SystemFeatures.html#1013564.
-Jeff Ishaq
-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
