because!!!!! REMEBER!!!!!! you forgot the zero (NULL) at the end of the 
string!!!

FieldHandle = GetFieldHandle(fieldID,StrLen(textP)+1);

or

Handle = MemHandleNew(Size+1);

Cheers!

James

Ravindra wrote:

>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/

Reply via email to