On Mon, 09 Jun 2003 19:28:14 +0800, Tony Cheung wrote:

> 
> 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.
> 
> Specifically, when my application is run, it opens a database with 
> read/write access. The application also needs to open read access to the 
> database, when sysAppLaunchCmdAttention is received.
> 
> Now, if the application is active when that launch code is received, the 
> launch code handler only needs to reuse the existing database handle. On 
> the other hande, if the application is not active, it would simply have 
> to open the database in read only mode. Thus, I would like to know if 
> the application is active and I would also need to access its global 
> variables, if it's active.
> 
>

Hi Tony,

I don't know the specifics of the sysAppLaunchCmdAttention
launchcode, but in general:

if you receive a launch-code where you know you have a global environment
available, you can check the sysAppLaunchFlagNewGlobals passed in the
launchFlags. If it is set, you are newly created, if it is not set, you
know you were running before and can reuse your current global variables

e.g.: i do a check  to decide if i were active when a global find was done
by the user:

if ((cmd == sysAppLaunchCmdGoTo) && (launchFlags & sysAppLaunchFlagNewGlobals) )
                mViewer = CreateViewer();
        else    
                mViewer = gViewer;      // using existing globals


best regards,

sebastian



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

Reply via email to