iajfoj jgoiejoisjo wrote:
> static int CompareRecordFunc(UPCD *rec1, UPCD *rec2, int unusedInt,
>        SortRecordInfoPtr unused1, SortRecordInfoPtr unused2, int appInfoH)

> UInt32 recordNumber = DmFindSortPosition(dbP, &FindRecord, 0,
>        (DmComparF *) CompareRecordFunc, 0);

I don't know exactly what your problem might be, but I can make a
suggestion:  by casting the function pointer to a DmComparF*, you
are defeating a lot of type checking that makes sure you have
the right argument types.  So, I would declare CompareRecordFunc()
with EXACTLY the same argument types as described in the documentation
and then call DmFindSortPosition() without the cast.  If you have
the argument list right, it should not require a cast.

Yes, this means you will have a void* for your two records
inside of CompareRecordFunc(), and you will have to cast those
back to UPCD* inside that function.  But that's OK.

In particular, one thing I notice about your CompareRecordFunc() signature
is that you are using an "int" for the third argument and for the
last argument.  In the documentation, it shows the third as an Int16 and
the last as a MemHandle, and the two of those aren't the same size!

  - Logan

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

Reply via email to