Hi everyone
I have set up this TableLoadDataFuncType function, as shown below, but when
I try to run the app, I get "invalid handle" when the table tries to draw
itself.
The stack trace looks like this:
TblDrawTable
DrawTable
DrawItem
DrawTextItem
InitTextItem
FldSetText
< in here my function gets called, and executes and returns ok and is
removed from the stack >
MemHandleLock
PrvHandleCheck
ErrDisplayFileLineMsg
Can anyone tell me what I am doing wrong?
Thanks
--------------------------------
Err DataLoader( void *tableP, Int16 row, Int16 column, Boolean editable,
MemHandle *dataH, Int16 *dataOffset, Int16 *dataSize, FieldPtr fld )
{
MemPtr textP;
MemHandle tempH;
// allocate a new movable chunk in the dynamic heap, to hold the text
string
tempH = MemHandleNew( TEXT_LENGTH + 1 );
dataH = &tempH;
// get a ptr to it
textP = MemHandleLock( *dataH );
// store string in the chunk
StrCopy( textP, "some text" );
// set up the output parameters
dataOffset = 0;
*dataSize = StrLen( textP ) + 1;
// unlock handle (so table object can use it)
MemHandleUnlock( *dataH );
return(0);
}
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/