> From: Jeff Ishaq [mailto:[EMAIL PROTECTED]]
> I'm using a temporary database to offload some string storage into
> the storage heap. This database essentially holds the strings that
> appear in a dropdown list of selections.
>
> In doing this, I have locked down 15 different chunks.
> Is there a more efficient way to do this?
Two alternatives come to mind:
(1) Condense the 15 separate chunks into a single chunk with the 15 strings
stored end-to-end, each terminated by a null byte. Then continue to create
an array of pointers to these strings so you can still call
LstSetListChoices().
(2) Use the custom draw callback technique. This would let you leave each
string's chunk unlocked most of the time, and only lock a chunk long enough
to draw it in your callback.
Going further with (2), just where do these 15 strings come from? Why do
they need to be heap-based like this? It sounds like you are creating them
on the fly because they can't be pre-built directly in the form resource or
as a standalone resource. If so, see if it's feasible to create each string
on the fly at the moment it's drawn, so you don't need to store anything at
all. If so, use a draw callback function that builds the string at the
moment of the draw. This will use up minimal memory, and hopefully won't be
too slow.
-slj-
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palm.com/devzone/mailinglists.html