Hi,
In my C based app, I have form loaded via FrmDoDialog (launched w. palmcall) on which
I want to show the available database categories on a list.
I thought this was simply a matter of giving LstSetListChoices a pointer into the
categoryLabels[dmRecNumCategories][dmCategoryLength]
array in the DB appinfo block.
This does seem to work fine, until I click on the list to display it upon which Pose
errs with a nasty bus error.
I tried copying the appInfo structure into a local structure and passing that, but I
have the same problem.
I've tried casting the pointer to LstSetListChoices differently but same problem.
Does anyone know how to do this? I'm stumped :(, I thought the problem was in how I'm
passing it to LstSetListChoices but I'm not sure....
Here's roughly what I'm doing:
// Declare appinfo pointer and local appinfo struct
MyAppInfoType *appInfo = NULL, MyappInfo;
// Successfully get appInfo from db
DmOpenDatabaseInfo(pOpenBmDB, &dbID,NULL,NULL,&cardNo, NULL);
DmDatabaseInfo(cardNo,dbID,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,&appInfoID,NULL,NULL,NULL);
// Lock it
appInfo = MemLocalIDToLockedPtr(appInfoID,cardNo);
// Copy it to local structure
MyAppInfo = *appInfo;
// Set list to it
LstSetListChoices(pList, (Char **)MyAppInfo.categoryLabels, NumCategoriesVariable);
// Unlock appInfo after deleting DoDialog form.
// Standard appinfo struct included earlier.
typedef struct
{
UInt16 renamedCategories;
char categoryLabels[dmRecNumCategories][dmCategoryLength];
UInt8 categoryUniqIDs[dmRecNumCategories];
UInt8 lastUniqID;
UInt8 reserved1;
UInt16 reserved2;
} MyAppInfoType;
--
__________________________________________________________________
Your favorite stores, helpful shopping tools and great gift ideas. Experience the
convenience of buying online with Shop@Netscape! http://shopnow.netscape.com/
Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/