Nope, the document states that, though not in the exact words "IT DOES
NOT MAKE A COPY".

->LstSetListChoices (ListType *listP, Char **itemsText, UInt16 numItems)
->Parameters : itemsText Pointer to an array of text strings.

So, u would have to do something like this:
void foo()
{  Char* *strArray;
   Char* strBuf;
   ListType *lstP;
   Int8 i;

   /*lstP = ? get the pointer to your list here */
   strArray = MemPtrNew(sizeof(Char*));
   for (i = 0; i < 10; i++)
   {
       strBuf = MemPtrNew(5);
       StrPrintF(strBuf, "str%d", i);
       strArray[i] = strBuf;
   }
   LstSetListChoices(lstP, strArray, 10);
}

of course, you would have to check the return val of MemPtrNew, I didn't
do it here. Hope this helps!


Jason Garrett wrote:
> 
> Does LstSetListChoices() make its own copy for the list to use, or does it continue 
>to use the memory that you have indicated in this call?
> Could I destroy my string list, and the list remain happy?
> 
> Jason Garrett
> wirelessdata
> Ph: +64 9 379 3710  Fax: +64 9 379 7360 Cell: +64 21 400 307  ICQ: 44334435

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to