CDockBar::Insert

There has been a huge bug in this MFC function for the last decade.  It shows up in applications that have many toolbars when you have some toolbars hidden and multiple rows of toolbars.  It mis-calculates the number of toolbars rows and drops you toolbar in some row below where you specify.  It's hugely annoying to the point of be unusable.

It would be soooo easy to fix and it's very difficult to work around.

What is it going to take for Ms to fix it    Pleeeeaaase, I'm begging here.  This is exactly where the bug is:

CDockBar::Insert
...


for
(nPos = 0; nPos < m_arrBars.GetSize(); nPos++)
   {
   CControlBar* pBar = GetDockedControlBar(nPos);
   if (pBar != NULL && pBar->IsVisible())
      {
      CRect rectBar;
      pBar->GetWindowRect(&rectBar);
      ScreenToClient(&rectBar);
      nWidth = max(nWidth, bHorz rectBar.Size().cy : rectBar.Size().cx - 1);
      if (bHorz rect.left > rectBar.left : rect.top > rectBar.top)
         nPosInsAfter = nPos;
      }
   else // end of row because pBar == NULL
// No, this is not neccesarily the end of the row because there may be a hidden
// toolbar (!
IsVisible()) in the middle of the row. 
// "else" doesn't mean pBar == NULL
 
      {
      ...




This is a couple of line fix and it would make toolbars work so much better.




Answer this question

CDockBar::Insert

  • Pictor

    Hi Steve,
      Here is the link for the bug: http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx feedbackid=bb459db0-8996-4750-a4fb-6d33966563e1

    Please keep an eye on the above link and you should have updates there once the owners look into the issue.

    Thanks,
      Ayman Shoukry
      VC++ Team

  • Tom Nunamaker

    Thanks for raising the issue.

    Could you please log a bug at http://lab.msdn.microsoft.com/productfeedback/default.aspx

    After you log the bug, please post the link in this thread and I will make sure the reponsible folks take a look at it.

    Thanks,
      Ayman Shoukry
      VC++ Team

  • biggoron311

    Than'ks Ayman,

    I logged it as bug FDBK35265, but I wasn't sure how to get the link.  Any help getting this addressed would be greatly appreciated.


  • CDockBar::Insert