Keith wrote:
> ... recordH is a MemHandle* -- a pointer to a MemHandle.

Good catch!

>MemHandle * recordH;
>...
>*recordH = DmGetRecord( db, index );

You should probably just get rid of the asterisks. Either that or allocate a
handle for recordH to point to, but this is getting weird...

        recordH = MemPtrNew(sizeof(MemHandle));

A "handle" is basically just a pointer to a pointer, but it's an opaque
type. You can't just dereference a handle to get at the pointer inside it;
you have to use MemHandleLock to do that. Generally, you don't need a
further level of indirection.

Are you using the Palm OS Emulator (Poser)? I'd expect
>*recordH = DmGetRecord( db, index );
would be likely to trigger a warning (assuming you have the warnings
enabled, which you should). It all depends what recordH's initial value was.
If it happens to point to valid memory, Poser won't complain, but the
assignment will still trash whatever's there.
-
Danny

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

Reply via email to