> From: Alfred Wallner [mailto:[EMAIL PROTECTED]]
> then I am trying to change field d with DmWrite like this:
> err = DmWrite(memP,5,&val,2);
Never use hard coded numbers for structure member offsets! Use an OffsetOf
type of macro to make the compiler do the math for you.
> From my record structure, I picked 5 as the byte offset value
> for DmWrite, but that doesn't work, so I have to pick offset 6
Don't eyeball a structure and try to figure out the member offsets, as this
is extremely error-prone. In this case the 'd' member is indeed at offset 6
(not 5) due to the way members are aligned.
-slj-
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/