Click to See Complete Forum and Search --> : Destructors


timber
May 12th, 1999, 05:15 PM
Hi,
I have created, using the MFC class wizard, a form (dialog). In adding my code I have noticed no destructor created by the class wizard. Because I have created a object using the 'new' keyword in the constructor, I need to 'delete' the object using a destructor. Do I add my own destructor? When trying to do this and after typing the symbol '~' in the cpp file VC++ inserts '_AfxCbtFilterHook' in front of the symbol. Is this normal behavior?

Steve P.

Rob Wainwright
May 15th, 1999, 03:17 AM
You only need to add your own destructor if you have allocated extra memory on the heap within your derived class. If you haven't the base destructor supplied in CDialog or whichever class you're using is sufficient.

I haven't got a clue what the _AfxCbtFilterHook is doing. I can't remember seeing it.

HTH
Rob