Danny, thanks!  I tried your suggestion to simply tell ExgDBRead that I
deleted the file (from the DeleteProc function) and it works.  The only
other thing I had to do was clear the read-only attribute using code like
this (error handling omitted here):

DmDatabaseInfo(0, *newID, NULL, &attr, NULL, NULL, NULL, NULL,  NULL, NULL,
NULL, NULL, NULL);
attr = attr & ~dmHdrAttrReadOnly;
DmSetDatabaseInfo(0, *newID, NULL, &attr, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL);

This makes the copy in RAM not read-only.  Everything works.  Insider shows
me that I have two copies, one in RAM and one in ROM.  Right now I'm testing
by copying the Expense prc to RAM and it appears to work.  the App Info
screen (from the App Launcher) shows only one Expense program and I can
execute it.  I assume I'm getting the one in RAM but don't have any way to
tell.

I'll work with this next week with FlashPro and see how it goes.  Thanks
again!


PS. If you want something else to think about, my next step is for me to
check that my own program (the running program that is going to do this
ROM-to-RAM copying) is in ROM and copy "itself" into RAM then re-launch
itself.  If I cannot get it to re-launch itself then a SysReset will do the
job for my purpose.



"Danny Epstein" <[EMAIL PROTECTED]> wrote in message
news:61447@palm-dev-forum...
>
> > ... the ExgDBRead function calls
> > the DeleteProc function to try and delete the original PRC in ROM since
> I'm
> > trying to write the same named file out to RAM.
>
> Try passing ExgDBRead your own DeleteProc that just says "sure, I deleted
> it, yah - that's it", but doesn't actually delete anything. I'm not sure,
> but I think ExgDBRead will proceed normally. It calls DmCreateDatabase,
> which only checks that such a database doesn't exist in RAM, so it should
be
> okay.
>
> Another alternative is to copy the database record-by-record (or
> resource-by-resource). If it's your own database, and you know it doesn't
> have sort-info or app-info blocks, this is pretty easy. In your case, I
> think it's an application, so all you have to handle is copying resources.
> There are Data Manager functions to count resources, retrieve resource
info
> and data, and create resources. Put them together and you have a copy
> routine.
>
> DmNumResources
> DmResourceInfo
> DmGetResourceIndex
> DmReleaseResource
> DmNewResource
> and of course, DmWrite
> --
> Danny @ Palm
>
>



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