Hi,

I have a problem with the sysAppLaunchCmdAlarmTriggered message. I want to
access some global variables if the application is active. I use the
sysAppLaunchFlagSubCall mask to find out if my application is launched
already. However, when I try to access a global variable, POSE 3.0a3 running
PalmOS 3.3 debug tells me that my has just read directly from low memory.
Here is some sample code (look for !!!).

int iGlobalVariable;

DWord PilotMain(Word cmd, Ptr cmdPBP, Word launchFlags)
{
   Boolean bAppIsActive = (Boolean)(launchFlags & sysAppLaunchFlagSubCall);

   if(cmd == sysAppLaunchCmdNormalLaunch) {
      // removed a bunch of stuff here
      return 0;
   }
   else if(cmd == sysAppLaunchCmdAlarmTriggered) {
      if(bAppIsActive) {
         // !!! POSE 3.0a3 with PalmOS 3.3 debug
         // !!! gives this error:
         // !!! "Your application has just read directly from low memory"
         iGlobalVar = 12;                                       
      }
      SndPlaySystemSound(sndAlarm);
   }

   return sysErrParamErr;
}

Is it me, or is it a feature or is it a bug?

Thanks,

Mike McCollister

Reply via email to