Thanks very
much Neil. I don't actually need globals, so assuming this works I
should be all set to go!
Thanks,
Gary
Neil Whitworth wrote:
[EMAIL PROTECTED] wrote:
I have a background application, which has no
UI whatsoever, that has
unfortunately grown beyond the 64K segment limit. I need to figure out
some way to call code accross segments, without being launched with
sysAppLaunchCmdNormalLaunch. Specifically, I need to find a way to
launch myself with globals, and not trigger any UI at all (i.e.
SysAppUISwitch is not an option). I'm using Codewarrior 9.3, and
targetting PalmOS 5.4, specifically the Treo 650.
Here's what I understand:
- You cannot call anything out of your first segment on a no-globals
launch.
- The above is true, no matter what magic you use in Codewarrior (e.g.
expanded mode doesn't help).
- You cannot call yourself using SysAppLaunch and pass
sysAppLaunchFlagNewGlobals, as that will eat up an owner ID every time
you do it.
So, do I have any options at all here? Is there any way to get my app
launched in a context where I can call other segments, short of
SysAppUISwitch? Surely there is a way to do this.
Thanks,
Gary
CW's expanded mode will get you access to some c++ features (virtual
functions) which can be useful.
ALso in their runtime library, you can find a function called
__LoadAndRelocate__. This is the function that loads up all other
segments. It is not called normally for non-global launch codes, you
can can use it to load up your other segments. This can get you passed
your 64k limit. Still no globals tho :( Pass true as the first argument
to load/lock code segments, and false to unlock/unload segments.
SysAppInfoType *appInfoP = NULL;
SysAppInfoType *rootAppInfoP = NULL;
appInfoP = SysGetAppInfo(&rootAppInfoP, &appInfoP);
/* Relocate multi-segment applications */
MTWK::__LoadAndRelocate__(false, appInfoP->codeH);
--
For information on using the PalmSource Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
|