"Jim Moy" <[EMAIL PROTECTED]> wrote in message news:42454@palm-dev-forum...
> The code appears to work correctly, no errors returned, but the
> resulting database is corrupt right at the first record.
Is there a pattern to the corruption?
> The data's
> good: if I accumulate the same data I'm passing back to the ReadProc
> in a big buffer and call DmCreateDatabaseFromImage() on the buffer
> (assuming my data's <64KB), then things are fine.
That's a good test.
> The docs say it knows when to stop calling my ReadProc by the info in
> the header, but I get called one more time after all the data's been
> passed back. I assume that I just immediately set (*sizeP = 0) and
> return errNone, but it has me worried because it seems inconsistent
> with the doc.
The docs are indeed incorrect. The headers don't indicate how big the last
record/resource is. The only way ExgDBRead can know when the last
record/resource is complete is by waiting for the readProc to return *sizeP
= 0. This is because the prc/pdb format specifies the offsets for the start
of each record/resource rather than the end.
> Also, the docs indicate the cardNo is _passed_back_ to the caller of
> ExgDBRead(), but the param is passed by value, which appears to
> prevent that.
You tell it which card to create the database on. Typically, this is 0.
--
Danny Epstein
OS Engineer, Palm Inc.
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/