I'm using dynamic lists in my app, with the data coming from a database.

I create the list here--

case frmOpenEvent:
    LstNewList(&form, 5000, 10, 10, ....trgEntryClient);
    ...

then when I get a ctlSelect--

case ctlSelectEvent:
    switch(event->data.ctlSelect.controlID) {
        case trgEntryClient:
            handled = trgEntryClient_Select(event, 5000);
            break;
    ...



Okay, so now in my trgEntryClient_Select() function, I create a list
(Char**) by reading the database and doing a bunch of MemPtrNew() calls.
This gives me an array of pointers to strings, which is exactly what
LstSetListChoices() needs.  I then reposition the popup list near the
trigger control and continue...


The problem is that all of those MemPtrNew() functions need to have matching
MemPtrFree() calls.  But when do I do this?  I need to the memory to be
locked long enough for the user to select an item in the list and then for
that item to be populated in the trigger control.  When should I deallocate
the memory?

Thanks, Ryan





-- 
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