On which line does the error occur? (this is super useful) And, what purpose does fieldText serve? Once you unlock the chuck this pointer is no longer valid.
Can you assign a locked handle to a field? Not sure on that one. --- Tim Kostka "JAMES S HAINES" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > The emulator is returning an error indicating an unlocked chunk error. As > it explains this is caused by trying to use a pointer returned by a handle > after it has been unlocked. I suspect there may be something wrong in this > function. Can anyone give me some advice on this function or if there is > a problem at all. > > > > char *getFieldText(UInt16 fieldID) > { > FieldType *fldP; > Char *fieldText; > MemHandle h; > fldP=getObjectPtr (fieldID); > h=FldGetTextHandle(fldP); > if (h !=NULL) > { > fieldText= MemHandleLock(h); > FldSetTextHandle(fldP,h); > MemHandleUnlock(h); > } > else > fieldText=NULL; > FldSetTextHandle(fldP,NULL); > return fieldText; > } > > Thanks, > Jim Haines -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
