Jim Duffy wrote: >When I go to read the records back, I need to lock a "ItemType*" to see the >array of ItemTypes, but I first need to move over the "SystemType" which is >at the beginning of the record. > >If I increment the locked pointer by one, it moves the size of itself, which >is not the same size at the SystemType. > >Is there a way to move over the first struct and then lock the "ItemType*" >pointer?
The short answer is: yes, but it may take some "bit/byte-fiddling about" to get it exactly correct. In quasi C-code, from the top of my head, if I'm interpreting your question correctly, the answer would be something like: Record * recP; //... ItemType * itemP = (ItemType *)( (char *)(recP) + sizeof(SystemType) ); Note that I'm assuming the ItemType array starts at the byte immediately following the SystemType object, without allowing for possible padding in the Record structure. -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
