Steve K wrote:
Boris,
Although I do not have a solution for you, I too am attempting the same type of list manipulation.
I have taken your code as an example, however am running into problems.
My code is similar to yours, however, I am not reading the info from a DB instead it is hard coded. You said that you were loading the list fine, just having cleanup problems, I'm receiving a fatal error trying to load the list... What am I doing wrong?
static void PopulateList() { char** lstArray = (char**) MemHandleNew(2 * sizeof(char*));
Steve,
you are getting just a HANDLE here instead of a pointer! Therefore your assignment "lstArry[0] = (char*)MemPtrNew(8);" mis-uses a handle as an address and *boom*
FormType* frmP = FrmGetActiveForm(); ListType* lstP = (ListType*) FrmGetObjectPtr(frmP, lstDesc);
lstArray[0] = (char*)MemPtrNew(8); StrCopy(lstArray[0], "a"); lstArray[1] = (char*)MemPtrNew(8); StrCopy(lstArray[1], "b");
LstSetListChoices(lstP, lstArray, 2);
LstDrawList(lstP);
for (int i = 0; i < 2; i++) { MemPtrFree(lstArray[i]); } MemPtrFree(lstArray); }
-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
