> From: Prashanth
>
> ... (UInt32)OffsetOf(myrecordtype,text)...
> myrecoredtype contains two char pointers of which
> text is the second one. the problem is the offset
> starts from 4 bytes after the first char pointer and
> not from the start of the second text pointer which
> has to be the case.
>
If your structure contains two pointers, each pointer *is* 4 bytes.
Example 1:
typedef struct {
Char * one;
Char * two;
} myStruct;
Then OffsetOf(myStruct, two) == 4
Example 2: (Is this what you thought you were doing?)
typedef struct {
Char one[10];
Char two[10];
} myStruct2;
Then OffsetOf(myStruct2, two) == 10.
If this explains your problem, then I think you should read a book on C to
learn more. If this isn't your problem, then you may have to post again
with some additional explanation of what you expect and how it didn't work.
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/