I'm a newbie to both the Palm OS and the C language so I like writing to low
memory and violating the API whenever possible. ;)
I'm working on some code for a field that takes the selected text and
inserts some text on either side of it (think HTML tags and you see where
I'm headed). The code executes fine until I exit the application, then it
crashes POSE telling me I have "bad dmAccessP" or one time I got something
like "bad cmdPBP". If I knew what dmAccessP was I might be insulted. That
particular string of characters doesn't show up once in the KB.
Here's a snippet of the offending code:
case ctlSelectEvent:
openH = MemHandleNew(50);
openP = MemHandleLock(openH);
FldGetSelection( fldP, startPos, endPos );
switch( event->data.ctlSelect.controlID)
{
case ctlHello:
StrCopy( openP, "<tag>");
break;
...
}
strLength=StrLen(openP);
oldHandle = FldGetTextHandle(fldP);
FldSetInsertionPoint(fldP,*startPos);
FldInsert(fldP,openP,strLength);
FldDrawField( fldP );
FldSetInsPtPosition(fldP,*endPos+strLength);
FldInsert(fldP,openP,strLength);
MemHandleUnlock(openH);
FldDrawField( fldP );
MemHandleFree(openH);
handled = true;
break;
I'm running CW 8.2 and POSE 3.5 with a Palm M505 ROM. Win2k Server on a
PIII-450. Aquarius.
Can someone see my problem(s)?
David Beers
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/