Take a look at the old datebook code (<= 3.0, I believe). In that code you
will see a mechanism for manually creating jumps into another code resource
(far calls). We were able to achieve the use of the same mechanism in a
shared library, however, we were not able to make the different code
resources link into the same PRC, so we had to create a second PRC for the
additional resource. This worked, but it did not result in a single PRC,
which was our goal, so ultimately, we decided to just use a second shared
library instead as it was more straight-forward.
Kevin
> -----Original Message-----
> From: Rob Dugal [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, September 26, 2000 11:58 AM
> To: Palm Developer Forum
> Subject: Re: how to have multiple code resources in a shared library?
>
>
> OK, here's what I'd like to do. Create a second code resource
> within the shared
> library prc. The code in the 2nd code resource has no globals
> and is in fact
> just a wrapper around a set of functions in a static library.
> The entry point to
> this code resource will be a dispatcher routine which calls
> the other functions
> within this code resource. To call a function in the 2nd code
> resource I will
> get a handle to the 2nd code resource, lock it down, set some
> parameter data,
> and call the dispatcher function at the beginning of the 2nd
> code resource.
> This sounds pretty straightforward.
>
> The two problems I have is
> 1) How do I get codewarrior to create the 2nd code resource
> within the shared
> library prc?
> The Palm article "Shared Libraries and Other Advanced Project
> Types" seems to
> indicate that this is possible by using multiple targets in
> the codewarrior IDE
> but I cannot figure out how exactly to do this.
>
> 2) How do I get the handle to the 2nd code resource?
> I think this would be obtained using DmGet1Resource(type, id)
> but because I
> can't figure out step 1 I'm unable to proceed.
>
>
>
>
>
> Ken Krugler <[EMAIL PROTECTED]> on 26/09/2000 01:00:58 PM
>
> To: Rob Dugal/Certicom@Certicom
> cc: [EMAIL PROTECTED]
> Subject: Re: how to have multiple code resources in a shared library?
>
>
>
>
> At 12:00am -0700 00-09-26, Palm Developer Forum digest wrote:
> >Subject: how to have multiple code resources in a shared library?
> >From: "Rob Dugal" <[EMAIL PROTECTED]>
> >Date: Mon, 25 Sep 2000 10:26:28 -0400
> >X-Message-Number: 49
> >
> >I need to build a shared library which will be >64k. For
> some legal reasons
> >which I won't go into, I cannot use multiple shared libraries.
> >I've read several posts and documents on the subject and it
> seems that this
> >should be possible.
> >What I cannot figure out is how to get codewarrior to
> generate a PRC which
> >contains multiple code resources. The Palm article "Shared
> Libraries and Other
> >Advanced Project Types" just glosses over the details of how
> to build with
> >multiple code resources.
>
> From what I recall, CodeWarrior doesn't provide support (auto-magical
> handling of inter-"segment" jumps) for a multi-segment Palm OS shared
> library. You might be able to force it to work, with some tricks
> similar to supporting A4-globals in a shared library, but I haven't
> looked into it.
>
> Another option is to implement your own support for code resources -
> this is easiest if there are a few routines that wind up calling in
> isolation a bunch of other code. In that case you could create
> individual code resources (the resource type doesn't matter) with
> single entry points for each of these higher-level functions -
> locking the code & calling the routine is easy.
>
> -- Ken
>
> Ken Krugler
> TransPac Software, Inc.
> <http://www.transpac.com>
> +1 530-470-9200
>
>
>
>
>
> --
> For information on using the Palm Developer Forums, or to
> unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
>
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/