In the palm OS documentation they state that if you dynamically add form
objects that you must save the new FormType returned from the call because
the form may have actually moved in memory.  My question is, does this
invalidate any pointers to form objects that you might be storing?  My guess
is yes because of the bug I am seeing in my code.

Here is the scenario.  I have a form with a list on it.  I attached a
POL::CSimpleListCtl to it.  I then dynamically add a button to the form
which changes the form pointer.  When I go to re-access the list via
GetSelection(), I get weird results such as the wrong selection index or it
crashes.  I think the issue is due to the fact that when I attach the list
control, POL is saving the ListPtr returned from the form when attach was
originally called and now the saved list pointer is no longer valid.

The problem is that I am adding the dynamic button from a base class and I
have no idea what objects are attached on the current form.  It would seem
that POL should only store the form pointer and then call FrmGetObjectPtr
when ever it needs to access an object on it.

Has anyone else run in to this problem or are my assumptions incorrect?

Thanks,

Brad



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to