hi all,
i've written a code to display a password screen when Phone Application is
invoked. user has to enter correct password to open
static Boolean MainFormDoCommand(UInt16 command)
{
case Password:
pForm = FrmInitForm(PasswordForm);
button_ID = FrmDoDialog(pForm);
if(button_ID==PasswordEnterButton)//button ID comparison
{
//get the field ptr
Fld_ptr=FrmGetObjectPtr(pForm,FrmGetObjectIndex(pForm, Fld));
recH = FldGetTextHandle(Fld_ptr);
if(recH!=NULL)//if password entered
{
C_Pswd = (char *)MemHandleLock(recH);
StrCopy(c_password, C_Pswd);
MemHandleUnlock(recH);
}
}
else//if any other button or key pressed exit the app
{
EvtEnqueueKey(vchrLaunch, 0x0, 0x08);
}
FrmDeleteForm(pForm);//delete the form after use.
break;
}
this code behaves very unpredictably. it works sometimes and otherwise crashes.
crashes particularly when the phone wakes up from sleep mode (when the
backlight goes off).
i guess the event handling is not proper. can anyone please tell what could be
the mistake.
thanjs and regards,
sriram
--
For information on using the PalmSource Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/