To all who offered guidance, I have it working and it's great!  Now I can
distribute one .prc file containing basic sample data that used to require
three .pdbs.

Thanks all.

Mitch Fawcett
Tapn'see Software


> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Ben
> Combee
> Sent: Sunday, December 09, 2001 2:21 AM
> To: Palm Developer Forum
> Subject: Re: Installing sample data
>
>
> "Steve Mann" <[EMAIL PROTECTED]> wrote in message
> news:70650@palm-dev-forum...
> >
> > >Can anyone point to any examples of this to help get me started.
> I've
> > >searched using keywords CreateDatabaseFromImage, ExgDBRead and
> ExgDBWrite
> > >and I'm not making much headway.
>
> Steve, close, but a few misconceptions.
>
> > Using the PilRC plugin, you can fold a PDB into a PRC by including a
> > ".r" in your project that has something like this in it:
>
> First, .r files are Rez source files -- they're the output of the PilRC
> plugin, but the plugin is not needed to use them.  Rez is installed in
> all versions of CodeWarrior for Palm OS -- it was originally a Macintosh
> tool for making Mac OS format resources.
>
> > read 'CreatorID' (Resource#) "DBName";
>
> Where you have 'CreatorID', you mean 'TypeID'.  Databases have creators,
> but resources within a database have types.
>
> > Then, in your app start routine, use
> >
> > DmGetNextDatabaseByTypeCreator
> >
> > to find the database. If it's not there, do this to unpack it and
> install it:
> >
> > MemHandle resH = DmGetResource ( CreatorID, Resource# );
> > MemPtr resP = MemHandleLock ( resH );
> > Err error = DmCreateDatabaseFromImage ( resP );
> > MemHandleUnlock ( resH );
> >
> > Error handling has been removed to simplify the code. I hope that
> helps.
>
> Right -- you should note that what you are doing is storing the PDB file
> as a resource, then recreating it from the read-only copy in the app if
> its missing.  The type of the resource doesn't matter for the final
> output -- the output's creator ID and type ID are determined by its
> embedded PDB header.
>
>
>
> --
> 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/

Reply via email to