> I have a single pdb on my Palm device and I would like to duplicate it.

Your approach should work, but there are other options as well. See
http://www.escribe.com/computing/pcpqa/m45259.html for my post on the
subject from a week ago.

> DmDuplicateRecord(localPdb, &final, reg);  // Is there any function like
this?

Call DmNewRecord, passing it the size of the old record (MemHandleSize on
the handle returned from DmQueryRecord). Then lock the old and new handles.
To copy the data, use DmWrite, passing it the handle, a write offset of
zero, a pointer to the old record (locked handle) and the size of the record
(as above). Finally, unlock both handles and release the new record. The new
records will all be marked dirty, regardless of what you pass to
DmReleaseRecord. If this isn't appropriate, you can use DmSetRecordInfo to
fix it. You may need to use DmRecordInfo and DmSetRecordInfo for another
purpose: to copy the categories and/or private flags.
--
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