Re: RunModalLoop and destructor

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Sz Borbely (szabolcs_borbely_at_hotmail.com)
Date: 02/23/04


Date: 23 Feb 2004 09:56:10 -0800

Implement the virtual void OnCancel(); and virtual void OnOK();
members in your DCialog derived class. These functions get called by
thr framework when the call to the modal dialog returns. You can
access the dialog controls in these functions and do proper clean-up.
Good Luck!

jonasn@mail.tele.dk (Jonas Nielsen) wrote in message news:<563b4521.0402230216.f613034@posting.google.com>...
> I have a dialog box started with RunModalLoop. In this dialog there is
> a list box with pointers to memory allocated with new. When i close
> the whole program i would like to call delete on these pointers.
>
> Unfortunately DestroyWindow() isn't called when the dialog is
> destroyed and the list box is already deleted in the destructor of the
> dialog.
>
> So, how do i do delete on these pointers ?



Relevant Pages

  • Re: is it good, is it bad or plain eeevil ?
    ... > also players, monsters, even locations that you can enter. ... > a container, so objects can be easily nested. ... > player, simply changing some pointers. ... virtual void doAdd; ...
    (comp.lang.cpp)
  • c++ : a baseclass, derived classes, a list of baseclass pointers, a problem.
    ... virtual void func1 ... Now i created a list of pointers to insances of the baseclass ... How can I execute the right function? ... I use a pointer to the baseclass to loop trough the list. ...
    (comp.programming)
  • Re: Regarding DestroyWindow and CEdit dervied class
    ... You shouldnt need to call DestroyWindow. ... These control will be destroyed when the parent of the control is destroyed. ... why are you holding to the pointers unless you are using them for something other than destroying. ... recreate a new array of edit controls as before) I can no longer focus on the ...
    (microsoft.public.vc.mfc)
  • Re: RunModalLoop and destructor
    ... >I have a dialog box started with RunModalLoop. ... >the whole program i would like to call delete on these pointers. ... >Unfortunately DestroyWindow() isn't called when the dialog is ... MVP VC++ FAQ: http://www.mvps.org/vcfaq ...
    (microsoft.public.vc.mfc)
  • RunModalLoop and destructor
    ... I have a dialog box started with RunModalLoop. ... the whole program i would like to call delete on these pointers. ... Unfortunately DestroyWindow() isn't called when the dialog is ... destroyed and the list box is already deleted in the destructor of the ...
    (microsoft.public.vc.mfc)