I'm using a temporary database to offload some string storage into the
storage heap. Gotta free up some dynamic heap. This database essentially
holds the strings that appear in a dropdown list of selections. As such,
after the database is constructed with its 15 strings, I need to construct
an array of pointers to those strings (a char**) that I can then pass to
LstSetListChoices().
Two questions.
0) Is it bad to leave a handful of locked pointers-to-Dm-chunks lingering
around for the duration of a form? I'm quite aware that in Dynamic Heap
(MemPtrNew'd chunk pointers) world, this will cause nasty fragmentation. Do
I have more leeway in Storage Heap (MemHandleLock(DmNewRecord(...))'d chunk
pointers) world?
1) When the dropdown list is about to be drawn, I run through all the
record handles in this database and lock them down. In doing this, I have
locked down 15 different chunks. This allows me to create an array of
pointers, which I pass to LstSetListChoices(). I do this to ensure that the
List resource's string table contains valid pointers during its lifetime.
When the form is closed, I destroy the database. Is there a more efficient
way to do this?
Thanks! Later,
-Jeff Ishaq
Vanteon
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palm.com/devzone/mailinglists.html