"James Preston" <[EMAIL PROTECTED]> wrote in message
news:47651@palm-dev-forum...
> The original question still remains, though: what does the "free handle"
> error really mean?
It means that the handle being passed to PrvHandleCheck contains an odd
address. This is used to indicate that the handle was freed. So if you free
a handle and then try to pass it to a MemHandle* routine, you should get
this error.
> FrmDoDialog(frmP);
> fldPtr = (FieldPtr)FrmGetObjectPtr(frmP, FrmGetObjectIndex(frmP,
RegScreenRegCodeField));
> fldTextH = FldGetTextHandle(fldPtr);
> if (fldTextH) {
> charPtr = (CharPtr)MemHandleLock(fldTextH);
> .
> .
> // Do something with charPtr (just examining it, not changing it)
> .
> .
> MemHandleUnlock(fldTextH);
> }
> FrmDeleteForm(frmP);
This code looks okay to me, although I'd use FldGetTextPtr instead of
FldGetTextHandle to simplify the code.
> Just in case anyone cares, I found and fixed this problem, although I
> still don't know the actual cause.
Excellent!
> Necessary conditions: Call FrmDoDialog, call FrmAlert before calling
> FrmDeleteForm on the dialog. And do this before you've brought up
> the main form of your application. Then, the first call to EvtGetEvent
> will bomb with a fatal error.
I don't know why this would happen. Does this happen on all versions of Palm
OS? Can you send me a test app that reproduces the bug?
--
Danny Epstein
OS Engineer, Palm Inc.
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/