The attached code should exist in the CW "starter" project.  You have to
call the default app.

/***********************************************************************
 *
 * FUNCTION:    RomVersionCompatible
 *
 * DESCRIPTION: This routine checks that a ROM version is meet your
 *              minimum requirement.
 *
 * PARAMETERS:  requiredVersion - minimum rom version required
 *                                (see sysFtrNumROMVersion in SystemMgr.h 
 *                                for format)
 *              launchFlags     - flags that indicate if the application 
 *                                UI is initialized.
 *
 * RETURNED:    error code or zero if rom is compatible
 *
 * REVISION HISTORY:
 *
 ***********************************************************************/
static Err RomVersionCompatible(DWord requiredVersion, Word launchFlags)
{
        DWord romVersion;

        // See if we're on in minimum required version of the ROM or later.
        FtrGet(sysFtrCreator, sysFtrNumROMVersion, &romVersion);
        if (romVersion < requiredVersion)
                {
                if ((launchFlags & (sysAppLaunchFlagNewGlobals |
sysAppLaunchFlagUIApp)) ==
                        (sysAppLaunchFlagNewGlobals |
sysAppLaunchFlagUIApp))
                        {
                        FrmAlert (RomIncompatibleAlert);
                
                        // Pilot 1.0 will continuously relaunch this app
unless we switch to 
                        // another safe one.
                        if (romVersion <
sysMakeROMVersion(2,0,0,sysROMStageRelease,0))
                                AppLaunchWithCommand(sysFileCDefaultApp,
sysAppLaunchCmdNormalLaunch, NULL);
                        }
                
                return (sysErrRomIncompatible);
                }

        return (0);
}

Regards,

Steve

> -----Original Message-----
> From: McCollister, Mike [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, February 24, 2000 8:34 AM
> To: Palm Developer Forum
> Subject: Exit PilotMain on PalmOS 1.0 problem
> 
> 
> Hi,
> 
> I have some code that checks for a PalmOS version at startup. 
> If the PalmOS
> version is not right, then I display a FrmAlert and exit 
> PilotMain with a
> return of 1. This works for everything except for PalmOS 1.0. 
> After I press
> OK on the FrmAlert (stating that it needs PalmOS 3.5 or 
> greater to run) the
> form just pops up again. Do I need to return something other 
> than "1" to get
> this to work on PalmOS 1.0?
> 
> Here is my current PilotMain code
> 
> UInt32 PilotMain(UInt16 cmd, MemPtr cmdPBP, UInt16 launchFlags)
> {
>    UInt16 error;
> 
>    if(cmd == sysAppLaunchCmdNormalLaunch) {
>       error = StartApplication(); // return 1 if not the right Palm OS
> version
>       if(error)
>          return error;
> 
>       EventLoop();
> 
>       StopApplication();
>    }
> 
>    return 0;
> }
> 
> 
> Thanks,
> 
> Mike McCollister
> 
> -- 
> For information on using the Palm Developer Forums, or to 
> unsubscribe, please see http://www.palm.com/devzone/mailinglists.html
> 
> 

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html

Reply via email to