Michael wrote:
Regarding to the third party support, it said the transfer file is
"plain" files not for PDB files because it
writes the data on a "stream" to Palm memory, not as a "Palm Database".

This makes it sound like the data is NOT in a database.

And I work with CASL that has function can read file and it work
well. I use PDBingo and FileZ check the pdb and I can view the records
but with the rec size 4104 bytes(4k) and no attribute sets.

This makes it sound like the data IS in a database.

I will assume that the data IS in a database, but it's not a File
Stream database.  I will assume that the data is split up with
each PDB record containing a 4096-byte block, so that if you had
10,000 bytes in this "stream", you would have this:

        record number   contents
        -------------   --------
        0               bytes 0 - 4095
        1               bytes 4096 - 8191
        2               bytes 8192 - 9999

Is that an accurate description?

If so, then you can just modify your struct and your callback to
read directly out of the PDB instead of treating it as File Stream.
Use DmFindDatabase() and DmOpenDatabase() to open the database.
Put four things into your struct:

        typedef struct
        {
            DmOpenRef openRef;
            UInt16 recordCount;
            UInt16 recordIndex;
            UInt16 offsetInCurrentRecord;
        } YourStruct;

Then, in the callback, use DmQueryRecord(), MemHandleLock(),
MemHandleUnlock(), and DmReleaseRecord() to fill the buffer.

When you do the DmQueryRecord(), you get a handle back.
You can use MemHandleSize() on that handle and compare
it to offsetInCurrentRecord to know whether to move on to
the next record or fill the buffer from current one.

  - Logan

--
For information on using the Palm Developer Forums, or to unsubscribe, please 
see http://www.palmos.com/dev/support/forums/

Reply via email to