Ben Combee a �crit :

> At 03:48 PM 3/29/2004, you wrote:
> >Do I have to keep the ControlPtr returned by CtlNewControl or can I
> >forget about it and leave it up to the form to free the allocated memory
> >upon deletion? If I don't keep this ControlPtr, can I recover it later
> >in the usual way with FrmGetObjectPtrFromID?
>
> You can forget the pointer -- the actual control is stored in the form's
> block of memory.  Remember, anytime you add a control to a form, you may
> have invalidated all the pointers to the form and its controls that you've
> retrieved in the past.

My Programming Bible (which I should have read in the first place) says I must
call FrmRemoveObject to delete these dynamically created controls when closing
the form. Why? Doesn't deleting the form free all this allocated memory? Even
more so if the form structure gets expanded in memory when adding controls.


--
Luc Le Blanc



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

Reply via email to