Hi, Im developing an SDI with no File/View support app with MFC using Visual Studio 2010 RC and I need to add a dialogBar with some owner drawn buttons, so I'm following this tutorial (and the links to the MSDN it provides):
I derived the class and drawn the dialogbar resource like it said there and in fact my bar seems to be created but for some reason its not showing! I'm reading in the MSDN doccumentation that the resorce must have the visible attribute "unchecked" or even not having it at all, but in the resource editor you just can change it to true/false. I opened the .rc file with a text editor and deleted WS_VISIBLE , rebuild, execute...and still nothing happens.
I tried in 2 kind of wizard generated projects , one checking "Use a classic menu" and "menu bar and toolbar"
The first one just not shows the dialogbar without any errors, warning or assertions/exceptions, but the in the second option an assertion is triggered
void CFrameWnd::DockControlBar(CControlBar* pBar, CDockBar* pDockBar, LPCRECT lpRect)
ENSURE_ARG(pBar != NULL);
// make sure CControlBar::EnableDocking has been called
ASSERT(pBar->m_pDockContext != NULL);
if (pDockBar == NULL)
for (int i = 0; i < 4; i++)
if ((dwDockBarMap[i] & CBRS_ALIGN_ANY) ==
(pBar->m_dwStyle & CBRS_ALIGN_ANY))
pDockBar = (CDockBar*)GetControlBar(dwDockBarMap[i]);
ASSERT(pDockBar != NULL);
// assert fails when initial CBRS_ of bar does not
// match available docking sites, as set by EnableDocking()
ENSURE_ARG(pDockBar != NULL); <----------------------------------------------THAT ONE
ASSERT(m_listControlBars.Find(pBar) != NULL);
ASSERT(pBar->m_pDockSite == this);
// if this assertion occurred it is because the parent of pBar was not initially
// this CFrameWnd when pBar's OnCreate was called
// i.e. this control bar should have been created with a different parent initially
I've been researching a little and a "Dockbar" object it supposed to be created when you call the enableDocking methods...
I don't know what to do! This last case doesn't matter that much because i will probably stick with the classic menu (I don't need any toolbar/menubar in my project), but I think maybe posting it would help to clarify somehow(?)
So what do you suggest? Maybe is Visual Studio fault? Need to format the computer?Throwing it out of the window perhaps?I have no clue ...
Well, the I will skip the last part because I want it hard docked,thanks.
But the problem is that the dialog bar is not showing either way (dockable or not), and I'm sure than the
CBRS_TOP | CBRS_GRIPPER |CBRS_TOOLTIPS |
CBRS_FLYBY | CBRS_HIDE_INPLACE,
is executed and returns no error. This is what puzzles me.