Did you set a breakpoint at line Handle = MemHandleNew to see if it fails or
not when you get the error ?
I would bet so. In that case, that's a pretty obvious issue. You are
allocating big objects which may fail and you did not test the returned
pointer. A basic one.

------------------------------------------------------------------
Regis NICOLAS - Manager, Communication Software
Palm OS 5.0 Technical Lead

When the finger points to the sky, the idiot looks at the finger.

-----Original Message-----
From: Ravindra [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 12, 2002 8:12 AM
To: Palm Developer Forum
Subject: Null Handle..........


Hi friends,
I am getting following error
MemoryMgr.c ,Line:4340 ,NULLHandle.

Following is my code snippet

MemHandle GetFieldHandle(UInt16 ObjectID, UInt16 Size)
{
 MemHandle Handle;
 Handle = FldGetTextHandle((FieldType *) GetObjectPtr(ObjectID));
 if ( Handle == NULL )
 Handle = MemHandleNew(Size);
 return Handle;
}

void SetDataField( UInt16 fieldID, Char* textP )
{
 MemPtr FieldPtr;
 MemHandle FieldHandle;
 FieldHandle = GetFieldHandle(fieldID,StrLen(textP));
 FieldPtr = MemHandleLock(FieldHandle);// locked
 StrCopy((char *)FieldPtr, /* your data ptr*/textP);
 MemHandleUnlock(FieldHandle); //unlocked
 FldSetTextHandle((FieldType *) GetObjectPtr(fieldID),FieldHandle);
}

actually it shuld allow any value between 0-65000 as value of size variable
in above method
but when value goes above 6500 i started getting this problem.

Can any body suggest me what is the problem........And I will also like to
know alternative method to do same thing
with any other alternative if possible.

Thank you

Regards,
   Ravi


--------------------------------------------------------------
Nova Software, Mumbai, India



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

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

Reply via email to