This fine day finds me trying to use the PalmOSGlue.lib stuff in the
latest 3.1 SDK.  I want to use the technique of directly fetching the
address of the Text Manager function(s) I want to call, as a performance
optimization.

Now, there's a ROM function called IntlGetRoutineAddress which returns
the address in ROM of Text Manager functions.  It works, but only on OS
3.1+ where these functions are in ROM.  No surprise there.  But I'm
trying to use PalmOSGlue.lib for compatibility with OS 3.0.  So what I
really need is a function in PalmOSGlue.lib that will either (a) return
the appropriate ROM function address if running on 3.1+; or (b) return a
function address within PalmOSGlue.lib if running on 3.0 or lower.  This
will yield both compatibility _and_ best performance.

Guessing such a function would be called IntlGlueGetRoutineAddress, I
found that (a) such a function declaration is missing from any of the
3.1 SDK headers, but (b) it _does_ exist in PalmOSGlue.lib.  You can
compile and link to it if you explicitly declare it like this:

  // C++ style function declaration
  extern "C" VoidPtr IntlGlueGetRoutineAddress( IntlSelector );

But calling it this way... it crashes with "address error" on both OS
3.0 and 3.1.  So now I'm stuck.

My questions for people who know:

1. Is this function missing from the current headers on purpose?

2. Is it supposed to work?  It's possible that my extern declaration
shown above is wrong (with wrong parameters) which could certainly cause
a crash when called.  If so, what's the correct prototype?

3. Is this all going to work nicely in the next SDK?

-slj-

Reply via email to