Re: Destroy toolbar problem
bar is a C++ object associated with a windows control. Just as you created the control using CreateEx use DestroyWindow before deleting the object.
Re: Destroy toolbar problem
Unfortuality: This is first what I try. Result is this same: GDI object are not free....
Re: Destroy toolbar problem
Quote:
Originally Posted by olekba
Unfortuality: This is first what I try. Result is this same: GDI object are not free....
Then Would you be so kind to post a little more code to see what and how you created/loaded/destroyed the toolbar and in what class you are using it?
Re: Destroy toolbar problem
In reality, I extract this, what generate a problem, to another project. And this is in a first post. Here you can find, that this is normal CToolBar.
I try several thinks for destroy this GDI objects, like:
bar->DestroyWindow();
delete bar;
or
//ShowControlBar(bar,FALSE,FALSE);
//bar->EnsureParentFrame()->DestroyWindow();
// bar->SendMessage(WM_NCDESTROY);
//DestroyDockBars();
//CFrameWnd* pFrameWnd = bar->EnsureParentFrame();
//pFrameWnd->DestroyWindow();
But I still see, that nothink changing with a allocate a GDI objects. In my real application create/destroy toolbars is often. In one costumer computer is a problem, that if are to many allocate GDI objects - application crash.
Any ideas ?