if c_password is 10 chars, and C_Pswd is more than 10 chars, you could get
unpredictable results.


-- 
-------------------------------------------------------------------------
Free software  - Baxter Codeworks  www.baxcode.com
-------------------------------------------------------------------------


"Sriram V" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
hi,
declaration is char  c_password[10]; this is not really reqd. i've used it
just like that. i can use the char pointer which points to the text in the
field directly which infact i had done originally.  still wondering why is
it crashing.
thanx
sriram



On 10/14/06, Baxter <[EMAIL PROTECTED]> wrote:
How is c_password defined?


"V. Sriram" < [EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> 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/



-- 
For information on using the PalmSource Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/

Reply via email to