Have you checked if  "passH = MemHandleNew(12)"   return the valid handle ?

Like
if ( passH == NULL )
{
    // do error processing ....
}


----- Original Message ----- 
From: "Mike Gagne" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent: Friday, March 19, 2004 11:00 AM
Subject: MemoryMgr.c, Line 4365, NULL handle


> Okay I did some research on this subject in the forums and this type of
> problem has been posted by others, but the problem is not quite the
same...
>
> I originally thought that this problem was brought about by the compiler I
> was using, because at work I was using CodeWarrior for PalmOS 8.0 and at
> home I was using CodeWarrior for PalmOS 9.0.
>
> The SAME code would compile and work correctly from home, but would
generate
> the memory error if it was compiled at work.
>
> The error (MemoryMgr.c, Line4365, NULL handle) is generated during this
> function, on line 7:
>
> static Boolean SetPassword(void)
> {
> Boolean retval;
> MemPtr password;
> MemHandle passH;
>
> passH = MemHandleNew(12);
> password = MemHandleLock(passH);
>
> password = GetField(MainForm, MainTxtPasswordField);
>
> if (password == NULL)
> retval = false;
> else
> if (StrLen(password) < 4)
> retval = false;
> else
> {
> StrCopy(g_prefs.MyPass, password);
> retval = true;
> }
>
> MemHandleUnlock(passH);
> MemHandleFree(passH);
>
> return retval;
> }
>
>
> This function is called after the user presses "OK" on the home screen on
> first execution of the program; it sets the password that was entered.
The
> palm itself has plenty of memory left on it.
>
> -- 
> For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/
>
>



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

Reply via email to