>> Do the following instead:
>>     UInt8     *recPtr;
>>     recPtr = (UInt8 *) MemHandleLock(recHandle);
>>     ...
>>   MemMove(pSig, recPtr[sizeof(UInt32)],
> MemPtrSize(recPtr)-sizeof(UInt32));
>
>   Yipes!  Almost.  The above will actually move it forward sizeof(UInt32) *
> sizeof(UInt32) - probably more than you want.  To get the proper math, use a
> CharPtr instead for your recPtr - so when you add a number to it or use an
> array offset, it'll be doing single-byte moves instead of in increments of
> sizeof(UInt32).

Hmm.  Actually, since recPtr is a pointer to an 8-bit integer,
recPtr[sizeof(Uint32)] will be the fourth byte (sizeof(UInt32) *
sizeof(UInt8)).

Now that I look at the code more clearly, it seems that he actually needs a
&:
MemMove(pSig, &recPtr[sizeof(UInt32)], MemPtrSize(recptr)-sizeof(UInt32));


Neil

-- 
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