I have a list on a form that is populated via a list draw function and
LstSetDrawFunction.  The list is populated with the correct values
from the draw function.

I have a button on the form that kicks off the following code segment to get
the text for the currently selected item in the list.

If the low-memory access debugging flag is enabled in POSE, the following
error occurs

        application " has just read directly from low memory "

followed by a bunch of descriptive text about how this is not allowed in the
Palm OS.  This error is triggered by the line of code

        CharPtr listItem = LstGetSelectionText( pList, wSelected );

If I disable the low-memory access check, the text returned to listItem is
garbage.

This error does not occur if I do not use the LstSetDrawFunction with a
drawing function, but rather populate the list using only LstSetListChoices.

What I am missing?

Thanks!

--- code segment ---

FormPtr pForm = FrmGetActiveForm();

// get the selection index from the list
Word wID = FrmGetObjectIndex( pForm, MainLstMainList );
ListPtr pList = (ListPtr) FrmGetObjectPtr( pForm, wID );
Word wSelected = LstGetSelection( pList );

// get the text at that index in list
CharPtr listItem = LstGetSelectionText( pList, wSelected );

--- end code segment ---



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html

Reply via email to