Robert Moynihan wrote:
Hi Dean,
On Thu, 23 Mar 2006, Robert Moynihan wrote:
Actually, on second thought, I'm thinking that the problem might not be
the call to LstSetListChoices at all. The ListType objects may
still be
invalid, but the bigger mistake would be that you allocated memory for
the list elements within your FillLetsCookFormListWithData function().
As soon as you exit that function those memory allocations become
invalid, so, when the list tries to draw (not AT the LstSetListChoices
command, but probably shortly thereafter) it will crash.
This isn't correct; the memory allocations the OP did were done with
MemPtrNew and MemHandleNew. Those don't become invalid on exit from the
function where they were done.
Dean
But the OP declared them within the context of that function, so those
variables (titleItemList, etc.) become invalid for use by the list
after the function exits.
Err.... I see what you are saying. The memory allocations themselves
are not invalid after exiting the function, but the immediate reference
to them (the variable declarations) are. So the OP would have to be
careful to free that memory using pointers derived from the list itself.
--
Bob
www.rmobile.ca
--------------
Mobile software for handheld computers and smartphones
--
For information on using the PalmSource Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/