Hi and thanks for the help...
I keep getting a fatal error ..
MemoryMgrNew.c Line:XXXX , invalid handle
It seems to point to this wrapper function I pulled from
the palmdev book (rhodes) have a look and give me
an Idea as to how to fix it? or trap it somehow..?
this seems to generate the error after several runs through it
/***********************************************************************
* FUNCTION: SetFieldTextFromStr
*
* returns a field pointer takes the fieldID and a CharPtr String
************************************************************************/
static FieldPtr SetFieldTextFromStr(Word fieldID, CharPtr strP){
Handle txtH = MemHandleNew(StrLen(strP) +1);
if (!txtH)
return NULL;
StrCopy(MemHandleLock(txtH), strP);
MemHandleUnlock(txtH);
return SetFieldTextFromHandle(fieldID, txtH);
}
this is called from the above
/***********************************************************************
* FUNCTION: SetFieldTextFromHandle
*
* returns a field pointer takes the fieldID and a text handle
***********************************************************************/
static FieldPtr SetFieldTextFromHandle(Word fieldID, Handle txtH){
Handle oldTxtH;
FieldPtr fldP =FrmGetObjectPtr(FrmGetActiveForm(),
FrmGetObjectIndex(FrmGetActiveForm(), fieldID));
ErrNonFatalDisplayIf(!fldP, "Incorrect Field Specified");
oldTxtH = FldGetTextHandle(fldP);
FldSetTextHandle(fldP, txtH);
FldEraseField(fldP); // added this to clear field display
FldDrawField(fldP);
if (oldTxtH)
MemHandleFree(oldTxtH);
return fldP;
}
--
For information on using the ACCESS Developer Forums, or to unsubscribe, please
see http://www.access-company.com/developers/forums/