In your code snip below, it seems you are unlocking the memory
handle before you are done using it. You can't call MemHandleUnlock
until you won't be using the locked location. So move the MemHandleUnlock
to right before the return. Or use the FldGetTextPtr(fld) as the string
to pass to checkDBName rather than LCurrentStatPtr->NameString.
-Gabe
Palm Creations
static Boolean DatabaseOkButtonHook(void)
{
StaticRecordingInfo *LCurrentStatPtr;
FieldPtr fld = GetObjectPtr(databaseNameStringField);
gCurrentStatHand = MemHandleNew(sizeof (StaticRecordingInfo));
LCurrentStatPtr = MemHandleLock(gCurrentStatHand);
//here we're copying the new database name into memory
if (FldGetTextPtr(fld) != NULL)
{
StrCopy(LCurrentStatPtr->NameString, FldGetTextPtr(fld));
}
MemHandleUnlock(gCurrentStatHand);
if ( checkDBName(LCurrentStatPtr->NameString) )
{
FrmGotoForm(RecordForm);
}
else
{
FrmAlert(DbnameAlert);
}
return 0;
}