"John Lai" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi all, I really need your help. How do I read a record just containing 2 > strings with variable-length. > > For example, if the record is "string 1\x00string 2\x00", how do I extract > the 2 strings. > > MemHandle recordH = DmQueryRecord(dbP, index); > // ...don't know how to write at this point > MemHandleUnlock(recordH);
Are you still getting a "free handle" error? Char* s = (Char*) MemHandleLock(recordH); Char str1[StrLen(s) + 1]; StrCopy(str1, s); s += StrLen(s) + 1; // Advance pointer to next string Char str2[StrLen(s) + 1]; StrCopy(str2, s); This should work. Regards -Laurens -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
