> I had this working perfectly using C with 
> 
>   MemPtr recPtr;
>   recPtr = MemHandleLock(recHandle);
    ...
>   MemMove(pSig, recPtr[sizeof(UInt32)], MemPtrSize(recPtr)-sizeof(UInt32));
>
> I know that this is messy - but for various reasons it wouldn't work well
> for me using structs - however - when I move the app to C++ it will not
> compile at all - the line
>
>   MemMove(pSig, recPtr[sizeof(UInt32)], MemPtrSize(recPtr)-sizeof(UInt32));
>
> gives me an "invalid type" error referring to the recPtr[sizeof(UInt32)]
> part - I have tried doing recPtr+=sizeof(UInt32) also but it did not like
> it.

The problem is that MemPtr is a void *, and therefore you can't do pointer
arithmetic on it (how many bytes should it increment when you do a ++?), nor
can you access array elements with it.  Your code is illegal in both C and
C++ (CodeWarrior complains in both C mode and C++ mode).

Do the following instead:
    UInt8     *recPtr;
    recPtr = (UInt8 *) MemHandleLock(recHandle);
    ...
  MemMove(pSig, recPtr[sizeof(UInt32)], MemPtrSize(recPtr)-sizeof(UInt32));

Neil

--
Neil Rhodes
Calliope Enterprises, Inc.
1328 Clock Avenue
Redlands, CA  92374
(909) 793-5995     [EMAIL PROTECTED]      fax: (909) 793-2545

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