|
-
May 12th, 1999, 05:15 PM
#1
Destructors
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.
-
May 15th, 1999, 03:17 AM
#2
Re: Destructors
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|