"Shripada Hebbar" <[EMAIL PROTECTED]> wrote in message
news:72007@palm-dev-forum...
>
> Hi All
>
> I am using Metrowerks Codewarrior for PalmOS R6.
>
> I want to develop a hack and mange it
> using my own application.
>
> Can anybody please tell me
>
> 1. how to create Code Resources Metrowerks Codewarrior IDE .
>
> 2. How to get the address of a function defined in a code resorce
>     within a palm application.

You need to search for DemoHack on Google -- this is a hack that
includes source code and a CodeWarrior project, all ready for you to
take and customize.

When you create a code resource, the entry point for the resource will
be at the start of the resource.  To call it, you have to lock the
resource, then jump to the start of the section -- you'll get the
address from the MemHandleLock call.

If you want to call a function that is internal to the resource, you
will either need to make a map file and hard code the offset in the
section (bad idea) or use a jump table embedded in the code segment.
The jump table is used by shared libraries -- an install function is
setup at the start of the library resource, and that returns a pointer
to a table to all the other shared library functions.  If you look at
the SampleLib project in the SDK, you can see how to implement a
jumptable using CodeWarrior's inline assembly.  The shared library
wizard in CW for Palm OS V8 handles creating this table automatically.



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

Reply via email to