|
-
June 29th, 2003, 07:42 AM
#1
Destroy toolbar created with new
How do I destroy a toolbar created with new operator?
Do I use the same technique as I would with a modeless dialog box -- call DestroyWindow() and create a PostNCDestroy with a delete this or is a simple delete sufficient?
-
July 1st, 2003, 02:19 PM
#2
The toolbar will be auto destroyed when its parent is destroyed. since u created the MFC toolbar object with new (on heap) you need to delete it in the parents destructor.
-
July 1st, 2003, 05:25 PM
#3
I want to destroy it before the parent is destroyed. The toolbar has a very short lifetime on the order of a minute. It is a fly-out toolbar.
-
July 1st, 2003, 11:01 PM
#4
i think both options are ok.
Call Destroywindow () and delete (your toolbar) or in your toolbar derived class's PostNCDestroy () delete this.
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
|