I am stuck... I tried so many things and couldn't
figure out... My list is not showing anything! Please,
please help:

typedef struct{
  char fields;
}DBPackedRecord;

/* fid should be an int but I don't know how to unpack
an int */
typedef struct{
  Char *fid;
  Char *fname;
}DBRecordType;

static void MainFormListDrawItem(Int16 itemNum,
RectangleType *bounds, Char **unused) {
 MemHandle recHandle;
 DBRecordType *recF;
 char *recPtr;
 
 recHandle = DmQueryRecord(gF, itemNum);
 recPtr = MemHandleLock(recHandle); 
        
 /* unpack */
 UnpackRecord((DBPackedRecord *) recPtr, recF);
        
 WinDrawChars(recF->fname, StrLen(recF->fname),
bounds->topLeft.x, bounds->topLeft.y);
                
 /* unlock the handle */
 MemHandleUnlock(recHandle);
}

static void UnpackRecord(DBPackedRecord *packed,
DBRecordType *record){
 char *p;
 p = &packed->fields;
 record->fid=p;
 p +=StrLen(p) + 1;
 record->fname=p;
}

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.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