There is a work around for calling code outside of the first segment, but it's 
not pretty.  Basically, you have to load your code from your application 
resource, lock it, and then do some casting magic so that it becomes your 
function pointer so that you can call it.  If you're going to do that it's 
easiest to just have the code for one function in a single segment.  That way, 
you don't have to worry about nerfing through the segment to find your 
particular function.  
And for the record, even though Palm has stated that applications aren't 
supposed to perform complex operations during a hotsync, the reality is that 
there are times when you need to.  

-Jon

-------------------------------------------
Jonathan Hays
Palm OS Certified Developer
http://hazelware.luggle.com 
-------------------------------------------


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Adrien Regimbald
Sent: Friday, February 18, 2005 8:42 AM
To: Palm Developer Forum
Subject: Re[2]: Crash after HotSync


Hello Thomas,

Unfortunately, I believe you are stuck with using functions from the
1st segment for non-global launches such as a HotSync launch. Pointers
to code resources get placed within your program's global variable
space, which makes it possible for code resources from other segments
to be used. When global variables are unavailable though, these
pointers are no longer available, so you are stuck in the 1st segment.

Applications aren't really supposed to be performing complex and
lengthy operations during a HotSync launch anyway. If you would like
to perform such operations, one option you might consider is creating
a database record noting that certain operations need to be done, and
perform them the next time your application is launched normally.

Adrien.

Friday, February 18, 2005, 9:09:53 AM, you wrote:

TW> I just figured out, that the POL1(X).lib is not part of the
TW> first segment in my target configurations. That seems to cause the
TW> failure.

TW> Now I'm trying to shuffle the segments around, but I wonder
TW> how I'll manage that in the future, when the program's code size
TW> increases.

TW> I'm planning a program that contains a couple of more or less
TW> complex modules. Maybe someone of you can tell me whether a POL
TW> application with more segments than POL(x).lib-files are possible
TW> without headaches.

TW> Is there some clever way to route or "forward" POL functions
TW> to segments which are out of reach of one of the POL.lib-files?




-- 
For information on using the Palm Developer Forums, or to unsubscribe, please 
see http://www.palmos.com/dev/support/forums/

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please 
see http://www.palmos.com/dev/support/forums/

Reply via email to