I have also tried the suggested way:
a) Patch "PalmOS_Startup.cpp" from runtime to remove "static" from
__LoadAndRelocate__() and export __LoadAndRelocate__() in CWPalmOS.h
Recompile CWs "Palm OS Runtime".
Is there a easier way to get access to __LoadAndRelocate__() ?
b) Call __LoadAndRelocate__() in a single-segment-situation (e.g.
sysAppLaunchCmdNotify):
SysAppInfoType *appInfoP = NULL;
SysAppInfoType *rootAppInfoP = NULL;
appInfoP = SysGetAppInfo(&rootAppInfoP, &appInfoP);
MTWK::__LoadAndRelocate__(true, appInfoP->codeH); // load segments
AcceesFunctionFromSecondSegement(); // <- crashes!
MTWK::__LoadAndRelocate__(false, appInfoP->codeH); // unload segments
Any function call to segment two crashes. Anyone can outline this?
Note: The Emulator report accese to globals in __LoadAndRelocate__()
Enviroment:
CW 9.3 Pro
Neil Whitworth wrote:
Gary wrote:
Thanks very much Neil. I don't actually need globals, so assuming
this works I should be all set to go!
Thanks,
Gary
Its a trick we use in all our apps. I'd recommend reading the code in
the runtime library, as there are some situations when you don't need to
call it as the runtime does itself (normal launch being one), and you
should only ever call it once. Calling it a second time will cause
problems as the inter-segment jump tables get corrupted. (We have some
re-entrant launch codes that caused problems)
--
* * * * * * * * * * * * * * * * * * * * * * * * * * * *
Ralf Dietrich www: http://www.envicon.com
envi.con KG mail:[EMAIL PROTECTED]
Emser Platz 2 Tel: +4930-34902670
10719 Berlin/Germany Fax: +4930-34902671
--
For information on using the PalmSource Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/