thanks for all your help - finally, i made some
process (i hope so). But still, here is one problem: I
can only draw one item to the list. Somehow when I
unpack, I only get the first record. The database
should be in good format because the call to
DmNumRecords(gF) returns a correct count.
here is the code:
/* db struct */
typedef struct{
Int32 fid;
char fname;
}FDBPackedRecord;
typedef struct{
Int32 fid;
char *fname;
}FDBRecordType;
/* unpack db rec */
static void UnpackRecord(FDBRecordType *record,
FDBPackedRecord *packed){
record->fid=packed->fid;
record->fname=&packed->fname;
}
/* drawing routing. seems only one item is drawn */
static void MainFormListDrawItem(Int16 itemNum,
RectangleType *bounds, Char **unused) {
MemHandle recHandle;
FDBRecordType recF;
FDBPackedRecord *recFPacked;
recHandle = DmQueryRecord(gF, itemNum);
recFPacked = MemHandleLock(recHandle);
UnpackFRecord(&recF, recFPacked);
WinDrawChars(recF.fname, StrLen(recF.fname),
bounds->topLeft.x, bounds->topLeft.y);
MemHandleUnlock(recHandle);
}
Please do help...
thanks.
__________________________________________________
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/