The documentation doesn't seem to be entirely clear on whether the rec1 and rec2 parameters are handles or locked pointers. If they are handles, you would have to lock them before actually trying to dereference a pointer to look at specific data. (i.e. rec1ptr = MemHandleLock (rec1);), then use rec1ptr->prodID. The error message you got is consistent with this behavior, as using rec1->prodId is trying to dereference a handle, not a locked chunk. The SDK docs also suggest using DmQuickSort() for a large number of records. Any reason you're using DmInsertionSort()?
-Thomee Wright- "Shin Tanaka" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > I am not sure what I did wrong... This is what I did; > > typedef struct{ > Char prodID[MaxProdIDLen + 1]; > Char prodAlt[MaxAltIDLen + 1]; > Char prodDesc[MaxProdDescLen + 1]; > } FeiProduct; > > > static Int CompareIDFunc(FeiProduct *rec1, FeiProduct *rec2, Int unusedInt, > SortRecordInfoPtr unused1, SortRecordInfoPtr unused2, > VoidHand appInfoH) > { > Int result; > > result = StrCompare(rec1->prodID, rec2->prodID); > return(result); > } > > In Main program; > > ldbP = DmOpenDatabaseByTypeCreator(opening with dmModeReadWrite); > if (lpdP) > { > DmInsertionSort(ldbP, (DmComparF *) CompareIDFunc, 0); > DmCloseDatabase(ldbP); > } > > > > > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of Nesse, > Rustin > Sent: Wednesday, August 02, 2000 12:56 PM > To: Palm Developer Forum > Subject: RE: [Q] MemoryMgrNew.c Error Message > > > I've seen that alot. When you go to write to your record, are you > locking the pointer? Like this: > > recP = MemHandleLock( Record ); > // do processing > MemPtrUnlock( recP ); > > Sometimes I get that message if I unlock a pointer twice (or unlock > an unlocked pointer). > > -Rus > > >-----Original Message----- > >From: Shin Tanaka [mailto:[EMAIL PROTECTED] > >Sent: Wednesday, August 02, 2000 9:41 AM > >To: Palm Developer Forum > >Subject: [Q] MemoryMgrNew.c Error Message > > > > > >Hi, folks. I have a (newbie) question. > > > >Whenever sorting a large number of records (35,000+) using > >DmInsertionSort(), I receive this error message > > > >"MemoryMgrNew.c, Line:3081, Chunk not locked" > > > >What does it mean? Each record size is at most 70 bytes. I am using > >SPT1700 and CW R6 with 3.1 SDK. > > > > > >Thanks. > > > > > > > > > > > > > > > > > >-- > >For information on using the Palm Developer Forums, or to > >unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/ > > > > -- > For information on using the Palm Developer Forums, or to unsubscribe, > please see http://www.palmos.com/dev/tech/support/forums/ > > -- For information on using the ACCESS Developer Forums, or to unsubscribe, please see http://www.access-company.com/developers/forums/
