Im still having problems with the memory handles when I update fields on
forms - at least I think that is where the problem is.
My main form has eight fields on it and I use this routine, and another
version of it for strings.
void UpdateFieldTm(int newtime, ULong fieldname){
FieldPtr fld;
FormPtr frmP;
VoidHand oldhand;
CharPtr fldptr;
Int fldIndex;
frmP = FrmGetActiveForm();
fldIndex = FrmGetObjectIndex(frmP, fieldname);
fld = FrmGetObjectPtr(frmP, fldIndex);
oldhand = FldGetTextHandle(fld);
if (!(oldhand)) oldhand = MemHandleNew(11);
if (MemHandleSize(oldhand) < 11) MemHandleResize(oldhand, 11);
fldptr = MemHandleLock(oldhand);
StrIToA(fldptr, newtime);
FldSetTextHandle(fld, oldhand);
FldDrawField(fld);
MemHandleUnlock(oldhand);
}
It seems to work ok for the main form but as soon as I load another form
and try to update fields on it my program aborts. I can load other forms
and close them repeatedly and redraw the main form each time with no
problem. It seems that as soon as I update a field on another field I get
problems.
regards,
Dave Mottorn
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/