CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Destructors

  1. #1
    Join Date
    May 1999
    Posts
    136

    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.


  2. #2
    Join Date
    May 1999
    Posts
    69

    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
  •  





Click Here to Expand Forum to Full Width

Featured