I have one application that creates a database.  Each record in the database
is made up of these two structures:

typedef struct FormProperty
{
 char propertyName[50];w
 char propertyValue[255];
 int x;
 int y;
 int w;
 int h;
}FormProperty;

typedef struct UrlRecord
{
 char url[255];
 int numProps;
}UrlRecord;

Basically the record form is <UrlRecord><FormProperty><FormProperty> with an
arbitrary number of form properties.  I have a whole set of functions for
reading and writing these records and they all work nicely in the main
application which creates the database.

The problem I'm having now is that I have a second application that needs to
read these same functions so I've copied code from the first application but
it doesn't seem to be working.

In order to read through each record I do something like the following:

h = DmQueryRecord(dbPrefs,urlIndex);
 p = MemHandleLock(h);

 //The first item in the record is a UrlRecord object
 urlRec=( UrlRecord *) p;

//Move on the first FormProperty
p += sizeof(UrlRecord);
formProp= (FormProperty *) p;

The portion of the code where I read the UrlRecord works in the second
application but I get garbage when I increment the pointer to the
FormProperty part of the record.

Does anyone have any ideas why this might happen?  Thanks

Mark



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to