Regarding my earlier request for assistance; I found the details on the
upChr mechanism. I haven't had a chance to test it, though I recognize from
the description, that I may not have been holding down the key long enough
to generate the appropriate effect.

Nonetheless, I am at a loss to understand what is wrong with my code. The
page, at http://oasis.palm.com/dev/kb/faq/1494.cfm, claims that either a
debugger breakpoint or the use of global memory would be the cause of the
error.

My code responds ONLY to sysAppLaunchCmdNormalLaunch. Here is my PilotMain.
If the command code is anything other, no globals are used before PilotMain
returns with 0.

Does anyone have any idea why or how this code would cause the reset cycle?
It only happens if you hit reset a second time while its on the startup
screen. In these cases, the only thing on the stack is the two functions and
Err, so I can't imagine it would be overflowing!

I do use globals in the sysAppLaunchCmdNormalLaunch path.

Also, this is not reproducible on machines earlier than IIIxe, or OSes
earlier than 3.5. Has something changed that would cause the second reset to
send sysAppLaunchCmdNormalLaunch instead of the usual code?

static DWord StarterPilotMain(Word cmd, Ptr cmdPBP, Word launchFlags)
{
 Err error;
// Word crc;


 error = RomVersionCompatible (ourMinVersion, launchFlags);
 if (error) return (error);

 switch (cmd)
  {
  case sysAppLaunchCmdNormalLaunch:
//   crc = Crc16CalcBlock(NULL, 256, 0);
   error = AppStart();

   if (error)
    return error;

   nprefs.curSelectedBox = 0;
   nprefs.boxInverted = 0;

   if (prefs.frmID < MainForm)
    prefs.frmID = MainForm;
   FrmGotoForm(prefs.frmID);

   AppEventLoop();
   AppStop();

   break;

  default:
   break;

  }

 return 0;
}

DWord PilotMain( Word cmd, Ptr cmdPBP, Word launchFlags)
{
    return StarterPilotMain(cmd, cmdPBP, launchFlags);
}



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

Reply via email to