> MemHandle recordH = DmQueryRecord(myDB, index);
> MyRecordStruct *recordP = MemHandleLock(recordH);
> MemHandleUnlock(recordH);
> 
> Can I still access the data via recordP 
> or is the pointer no longer valid?

Once you unlock the handle, the OS can move the memory around if it
needs to. Therefore, you should not try to use the pointer after
unlocking the handle.

MemHandle recordH = DmQueryRecord(myDB, index);
if (recordH == NULL)    return;
MyRecordStruct *recordP = MemHandleLock(recordH);
MemMove(myStructP, recordP, sizeof(MyRecordStruct));
MemHandleUnlock(recordH);

Just checking...So, I can still access myStructP, since I now have my own
copy of the data, right?

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

Reply via email to