Hi, everybody:
i am new in Palm programming ...

i define a following type ..

typedef struct {
  Char name[2];
  UInt8 reserved;
} MyRecordType;

when i try to save a record ...

MyRecordType  newrecord;

recordH =
DmNewRecord(dbP,&CurrentRecord,sizeof(MyRecordType));

if (recordH) 
{
recordP = (MyRecordType*)MemHandleLock(recordH);
a = "nasri";
StrCopy(newrecord.name,a) ;
DmWrite(recordP,OffsetOf(MyRecordType,name),
&newrecord.name, sizeof(newrecord.name));
MemHandleUnlock(recordH);
DmReleaseRecord(dbP, CurrentRecord, true);
} 

when i retrieve the record, i use :

recordH = DmQueryRecord (dbP, CurrentRecord);
if (recordH)
{
recordP = (MyRecordType*)MemHandleLock(recordH);
hello = recordP->name;
FrmCustomAlert(MyAlert,hello, NULL,NULL);
MemHandleUnlock(recordH);
}

however, it comes out 'na0' ....
anybody knows the reason ?? it only can accept 3
characters ?? how do i define MyRecordType so that
'name' field can accept whatever user enter regardless
on how many characters it have ...

thanks a lot 


__________________________________________________
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards�
http://movies.yahoo.com/

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

Reply via email to