I'm trying to implement a number pad for faster data entry into fields. My
problem is I want to be able to use both the number pad and good old fashion
grafitti as well. I've gotten it to dynamically update the field based on
what was selected on the number pad, however, if I return to the field and
try to backspace or enter any data I receive the following error:
MemoryMgr.c, Line:4365,NULL handle
I'm pretty sure I know what is going on, so my question then is how do I do
it correctly. Here's the code as is:
//This function takes the number that was pressed on the
//number pad and concats it to whatever is already in the
//field.
static Boolean FldConcatText(FieldType* fldP, char* strBuffer)
{
if(fldP) {
//Get the current data of the field and concat strBuffer.
char* originalText = FldGetTextPtr(fldP);
UInt16 strLen;
if(originalText) {
strBuffer = StrCat(originalText, strBuffer);
}
strLen = StrLen(strBuffer);
if(strLen < FldGetMaxChars(fldP)) {
//Writes the strBuffer to the Field
FldFreeMemory(fldP); // initialize everything, just in case.
FldSetTextPtr(fldP, strBuffer);
//Set the cursor to the end of the field
FldSetInsPtPosition(fldP, strLen);
return true;
}
}
return false;
}
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/