At 04:31 PM 8/13/2003, Steve K wrote:
I am trying to set the choices in a list using LstSetListChoices, and know I
am getting very close to getting it to work.

I call my function to populate the list and I receive no error and I get no
data displayed in my list.

Here is the function.

static char* gPlateString =
"PL3/16x\0PL1/4x\0PL5/16x\0PL3/8x\0PL1/2x\0PL5/8x\0";
static char** gListString;
MemHandle gStringH;

static Boolean PopulateList(FormType* frmP, ListType* lstP)
{
    gStringH = SysFormPointerArrayToStrings(gPlateString, 6);
    gListString = (char**)MemHandleLock(gStringH);

    LstSetListChoices(lstP, gListString, 6);
    MemHandleUnlock(gStringH);

    return true;
}

The bug is that you unlock the gStringH handle after you've passed it's locked pointer to LstSetListChoices. That handle needs to remain locked until after the list that uses it is destroyed.


--
Ben Combee <[EMAIL PROTECTED]>
CodeWarrior for Palm OS technical lead
Palm OS programming help @ www.palmoswerks.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