Larry,

You can create a binary and other resources with CodeWarrior by creating a
text file with a ".r" extension in the RSC directory of your project
(example: "resources.r").  This will be a resource script.  To add a binary
resource use the following example:

read 'DICT' (1001) "dict.bin";

'DICT' is the resource type and can be whatever you choose just as long as
it is four characters.

(1001) is the resource id just like resource ids you assign with
Constructor.

"dict.bin" is the name of the file to include as a binary resource.  The
base path is the RSRC directory and you can use relative paths as in
"..\..\myfiles\dict.bin".

You then need to add the ".r" file to your project.  If the project
stationary you're using doesn't have a file mapping for ".r" files,
CodeWarrior won't understand what to do with it.  In that case, go to the
project settings, to the "File Mappings" settings, and add the following
file mapping:

File Type: TEXT
Extension: .r
Flags: None
Compiler: Rez

You then access the resource in your source code using the normal
DmGetResource() function as in:

MemHandle resHandle = DmGetResource( 'DICT', 1001 );

Just look at the Palm documentation for more details on using resources if
you're unfamiliar with them.  Remember that no resource can be larger than
64K.

Greg

"Larry" <[EMAIL PROTECTED]> wrote in message news:42197@palm-dev-forum...
>
> Greg,
>
> Thanks for the suggestion.  I have no idea how to add the library as a
binary
> resource to the prc, but
> I'll look into the Codewarrior documentation.  I'll let you know how it
goes.
>
> Larry
>
> Greg Martin wrote:
>
> > Larry,
> >
> > I've been meaning to try something myself and haven't gotten around to
it.
> > You can add the shared library as a binary resource to the prc.  You can
> > then lock the resource and copy the shared library out into its own prc.
> > The next step that I'm hoping will work (but haven't yet tried) is to
use
> > DmRemoveResource to remove the shared library from the application prc.
I
> > fear DmRemoveResource might return dmErrReadOnly, but until I try I
won't
> > know.  If you've tried this or will in the future, let me know if it
works.
> >
> > Greg
> > (a programmer who's so swamped that he doesn't even have time to run
this
> > simple test)
> >
> > "Larry" <[EMAIL PROTECTED]> wrote in message
news:42129@palm-dev-forum...
> > >
> > > Hi
> > >
> > > I'm working on an app that needs a shared library.  I would like the
> > > shared library to be embedded in the application's prc and upon
> > > initial run of the program it will install the shared library.  I know
I
> > >
> > > can just have the user install the shared library themselves, but I
> > > want to simplify the process as much as I can for the user.
> > >
> > > So in a nutshell, is there a way I can install the shared library's
prc
> > > from another app?  I was thinking about creating a long string with
> > > the contents of the prc and simply using ExgDBRead to install the
> > > library.
> > >
> > > Thanks for the comments and suggestions
> > >
> > > Larry
> > >
> > >
> > >
>
>
>



-- 
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