Hi friends,
I want your hlep.
In my application I want to display approx 64 k string data into a text
multiline textbox control.But I am not able to show data in text box getting
MemHandle Null error.following is the code snippet for method who take care
of creating memory handle .


static void SetFieldText( UInt16 fieldID, Char* textP )
{
   // UInt32 j;
 MemHandle newTextH, oldTextH;
 FieldPtr fieldP;

 fieldP = (FieldType*)GetObjectPtr( fieldID );
 ErrNonFatalDisplayIf( !fieldP, "Invalid field identifier!" );

 newTextH = MemHandleNew( StrLen( textP ) + 1 );
 ErrNonFatalDisplayIf( !newTextH, "Out of memory!" );


 StrCopy( MemHandleLock( newTextH ), textP );//

 MemHandleUnlock( newTextH );

 oldTextH = FldGetTextHandle( fieldP );

 FldSetTextHandle( fieldP, newTextH );
 FldDrawField( fieldP );

 if( oldTextH )
  MemHandleFree( oldTextH );
}


in above code MemHandleLock(newTextH ) methods gives above  error and when I
debug my code that time I come to know that this is due to
MemHandleNew(StrLen( textP ) + 1) new method in above code which gives me 0
memhandle.

My test size which is to be display will vary from 1 k to max 64 k ,when it
is 6 or 7 k that time it works fine but when it goes more that 7.5 or 8 k
that time I am getting above error.

So I am sure that there must be some limit for getting memory handle for
particular length string.
I want to know that limit ..........
Please help me to solve this problem and also give me some alternative way
to do this.

Thanks and 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