That make sense - I have tried the fix you suggested, and get the error
"incompatible type for argument 3 of DmWrite" So I guess it doesn't like
that. It only seems happy when I have &map[i].
My database structure is as follows:
// Structure of the Database
typedef struct {
Int32 mapID;
Char Xul[10];
Char Yul[10];
Char Xlr[10];
Char Ylr[10];
Char Bitmap[30];
} Map;
I didn't have the size of the variables defined before - it doesn't seem to
make a difference though. I get the same error.
Thanks for the help,
Sara
> From: Steve Mann <[EMAIL PROTECTED]>
> Date: Thu, 21 Jun 2001 08:59:43 -0700
> X-Message-Number: 52
>
> Another comment:
>
> > map[0] = &m1;
> > map[1] = &m2;
> > for (i = 0; i < numMap; i++) {
> > UInt16 index = dmMaxRecordIndex;
> > newRecordH = DmNewRecord(gLibDB, &index, sizeof(map[i]));
> > newRecordP = MemHandleLock(newRecordH);
> > DmWrite(newRecordP, 0, &map[i], sizeof(map[i]));
> > MemHandleUnlock(newRecordH);
> > DmReleaseRecord(gLibDB, index, true);
> > }
>
> You're saving pointers to static data that doesn't exist outside this
> function, and the record size is wrong. You need to save the data
> itself. This might do it (the sizeof probably won't give you what you
> want; it's hard to tell without seeing Map's definition):
>
> > DmWrite(newRecordP, 0, *map[i], sizeof( Map ));
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/