You have a MemPtrFree or MemHandleFree somewhere in your code which is
freeing the handle of a database record. This may be because you associate a
record with a field and do not disassociate the handle before closing the
form.

Matt

----- Original Message -----
From: "Brian Preston" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent: Tuesday, June 03, 2003 9:58 AM
Subject: another newbie with 'Free handle' error


> I searched through the archives and seemed to find
> some relevant threads on this. From what I read, it
> may have something to do with trying to unlock the
> wrong kind of memory. But I still don't quite have a
> handle (pun intended) on this error.
>
> Here's my code snippet:
>
> MissionDB mission;
> UInt16 index = -1;
> MemHandle recH;
> MissionDBPtr recP;
> UInt16 i, numRecs = DmNumRecords(gDB);
>
> mission.level = missionDiff;
>
> for (i = 0; i < numRecs; i++) {
>     recH = DmQueryRecord(gDB, i);
>     if (recH) {
>         recP = (MissionDBPtr)MemHandleLock(recH);
>         if (recP->level == mission.level) {
>             index = i;
>         }
>         MemHandleUnlock(recH);
>         if (index != -1)
>             break;
>     }
> }
>
> I'm basically just trying to find the index of the
> matching record. At the point of the error, I only
> have 2 records in my DB. I get the 'Free handle' error
> the 2nd time through the loop. What's really strange
> is I go through this function once before in the
> program, and it works fine.
>
> Thanks
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
> http://calendar.yahoo.com
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/
>
>


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to