I did get part of this to work by setting a global g_bAppOnCard boolean,
then if they eject the card, I successfully exit the application, but if the
application was started from RAM, then the default value of my boolean is
used, therefore we don't exit the app.
Next though I would like to prevent the OS from deleting the app from RAM
after an eject. According to the SDK, setting the bit below should do it, I
had no luck.
I would still like the sysAppLaunchCmdNormalLaunch notification, but if I'm
forced to set the err to errNone in order for the flag to stick, then I
changed my code to:
Hence, now I don't have that break, therefore I handle the
sysAppLaunchCmdNormalLaunch with the same notification, in both cases, the
VFS manager still removes the app.
Any ideas?
case sysAppLaunchCmdCardLaunch:
{
SysAppLaunchCmdCardType *params =
(SysAppLaunchCmdCardType*)cmdPBP;
params->startFlags = sysAppLaunchStartFlagNoAutoDelete;
params->err = errNone;
_bAppOnCard = true;
//break;
}
case sysAppLaunchCmdNormalLaunch:
{
TraceInit();
DisplayMemInfo( __FILE__, __LINE__, false );
// Initialize application.
err = AppStart ();
if (!err)
{
// Show the main form.
FrmGotoForm (HomeForm);
AppEventLoop ();
AppStop ();
//~84K of global variables will still be cleared out
}
DisplayMemInfo( __FILE__, __LINE__, false );
break;
}// end of sysAppLaunchCmdNormalLaunch
--
Bill Andreozzi
STATus Pro, Inc.
Phone: 425.869.0854
Mobile: 425.260.1127
E-mail: [EMAIL PROTECTED]
"Bill Andreozzi" <[EMAIL PROTECTED]> wrote in message
news:98726@;palm-dev-forum...
>
> I did find sysAppLaunchCmdCardLaunch and added some code:
> (to handle the event)
>
> case sysAppLaunchCmdCardLaunch:
> {
> SysAppLaunchCmdCardType *params =
> (SysAppLaunchCmdCardType*)cmdPBP;
> params->startFlags = sysAppLaunchStartFlagNoAutoDelete;
> break;
> }
>
> Unfortunately, my our app still gets deleted. Am I doing this correctly?
> thanks - bill
>
>
> --
> Bill Andreozzi
> STATus Pro, Inc.
> Phone: 425.869.0854
> Mobile: 425.260.1127
> E-mail: [EMAIL PROTECTED]
>
> "Bill Andreozzi" <[EMAIL PROTECTED]> wrote in message
> news:98721@;palm-dev-forum...
> >
> > When an application is launched from the card, the OS copies the app
from
> > the card into ram.
> > My problem is that I need to know whether or not our app is really in
ram
> or
> > that it will be deleted after the os quits.
> >
> > (e.g. if a card is ejected, I would like to launch our app from ram if
it
> is
> > there,
> > I did this by performing a dbID = DmFindDatabase( 0,
STR_AppDbName )
> > then looking at the dbID, unfortutely it always returns a value because
> the
> > app IS in ram, but when the app is exited, the OS removes the app from
> RAM,
> > thereby making the dbID invalid for SysUIAppSwitch( cardNo, dbID,
> > sysAppLaunchCmdNormalLaunch, NULL );. )
> >
> > Is there anything particular that I could look at to determine if the
app
> is
> > in ram or not?
> >
> > thanks - bill
> >
> >
> >
> >
> >
>
>
>
>
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/