Ron wrote:
> When I use LstSetListChoices to set the items in a list,
> whenver I click on an item it turns into garbbage. Random
> symbols and at some points it tries to access invalid
> memory.
>
> This is the code I'm using I am setting the text for a list
> created by the resource editor.
> -------------------
> Char* c[5] = {"one","two","three","four","asdf"};
> list = (ListType*)FrmGetObjectPtr(frm, FrmGetObjectIndex(frm,(UInt16)1000));
> LstSetListChoices(list, c, stringCount);
LstSetListChoices doesn't make a copy of the array of strings you pass in, and
it looks like the array you're passing in is a local variable. It's your
responsibility to make sure that the pointer you give to LstSetListChoices
remains valid for the lifetime of the List.
- James
--
For information on using the PalmSource Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/