>>>>>>>>>>>>>>
Subject: RE: Problem running app from Flash ROM
From: "Scott L. Johnson" <[EMAIL PROTECTED]>
Date: Wed, 15 Mar 2000 12:35:29 -0800
X-Message-Number: 51
> From: John Marshall [mailto:[EMAIL PROTECTED]]
> >[Quoting Bob Ebert...]
> >> Probably by keeping the [code segment] handle around
> >> in a different variable...
>
> Right. I didn't want to use up some more global space and complicate
> the startup code doing this, but perhaps we'll have to. :-(
Take a look at the equivalent in CodeWarrior, the function called
__LoadAndRelocate__() in PalmOS_Startup.c. It calls DmGet1Resource() to
recover the code segment handles to be unlocked. (And I sure hope that CW
multi segment apps are ROMable!) Would this work in GCC?
-slj-
<<<<<<<<<<<<<<
The problem with using DmGet1Resource here, is that if an app failed to
close some resource database that it had opened before exiting (SysAppExit
normally cleans this up, but later), then DmGet1Resource will fail to get to
the app's own database and will not find the requested handle (or equally
bad, might find a resource of the same type/id in the wrong database).
Vitaly
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palm.com/devzone/mailinglists.html