I've checked page 58 in the Companion, but it doesn't answer my
question about globals.  On the other hand, on page 57 it says
"Global variables are generally only allocated after an application receives
sysAppLaunchCmdNormalLaunch".

I'm using the following code in the app that does the launching:

    cmdPBP = MemPtrNew(sizeof(UInt32));
    if (!cmdPBP)
        return memErrNotEnoughSpace;
    MemPtrSetOwner(cmdPBP, 0);
    *(UInt32 *) cmdPBP = creatorID;

    err = SysAppLaunch(0, "MyApp", 0, sysAppLaunchCmdNormalLaunch, cmdPBP,
NULL);

which according to the Companion shouldn't be a problem for the launched
app to use globals, since it gets launched by sysAppLaunchCmdNormalLaunch,
unless it is the cmdPBP parameter that causes the problem since I'm passing
info
(the creator ID of the launching app) through it.

In the app that gets launched I've put the following code:

static DWord PilotMain(Word cmd, Ptr cmdPBP, Word launchFlags)
{
 Err error;
 UInt32 parentCreatorID;

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


 switch (cmd)
  {
  case sysAppLaunchCmdNormalLaunch:

   // Test the cmdPBP parameter. If it's NULL, then the Palm app launcher
         // launched us. Otherwise, it points to the creator ID of the app
that
         // launched us.
         if (cmdPBP)
         {
             parentCreatorID = *(UInt32 *) cmdPBP;
             MemPtrFree(cmdPBP);     // don't leak that memory

             /*Do something...*/
         }
   error = AppStart();
   if (error)
    return error;

   FrmGotoForm(MainForm);
   AppEventLoop();
   AppStop();
   break;

  default:
   break;

  }
 return 0;
}

What is the problem?

Regards,

/Bulent Gecer

Steve Mann <[EMAIL PROTECTED]> skrev i
diskussionsgruppsmeddelandet:[EMAIL PROTECTED]
>
> >When "MyApp" gets launched by another application with the call
> >SysAppLaunch(...), I get the following message in POSE:
>
> Check page 58 of the Palm OS Programmer's Companion.
>
> Regards,
> Steve Mann
> --
> -------------------------------------------
> Creative Digital Publishing Inc.
> 1315 Palm Street, San Luis Obispo, CA 93401-3117
> -------------------------------------------
> 805.784.9461              805.784.9462 (fax)
> [EMAIL PROTECTED]       http://www.cdpubs.com
>
>





-- 
For information on using the ACCESS Developer Forums, or to unsubscribe, please 
see http://www.access-company.com/developers/forums/

Reply via email to