Hai,
I need to write and read a structure to a database.
I am able to write that structure to a database with out an error.
But when i try to read that structure , i am getting all sort of junk
values.
Here is the code i am referring to
Definition of structure:
----------------------
typedef struct final
{
short indicator;
int p;
}final;
Procedure for writing:
----------------------
// fin is an instanace of final
// values are loaded into fin
//All the var's are appropriately initialised
//points is reference to database
textHandle = DmNewRecord(points, &index, sizeof(final));
textPtr = MemHandleLock(textHandle);
error=DmWrite(textPtr,0,&fin,sizeof(fin));
Procedure for reading:
----------------------
final *rec;
rec=(final*)MemHandleLock(recHandle);
But the values in rec are junk!!
Now , which of these procedures are wrong ?
Is it the reading one or the writing one?
Can structures be written this way?
Or should i write to offset or a recors?
Any help will be greatly appreciated.
Thanks in advance.
Regard's
--
Anne Srinivas
Software Engineer
InfoTech Enterprises Ltd.
Plot No 11,Infocity,
Software Units Layout,
Madhapur,Hyderabad 33
E-Mail :
[EMAIL PROTECTED]
[EMAIL PROTECTED]
Tel (Resi) : 3033761
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/