BUG: Toolbar Covers Document in MFC ActiveX Document Container (216461)
The information in this article applies to:
- The Microsoft Foundation Classes (MFC), when used with:
- Microsoft Visual C++, 32-bit Enterprise Edition 6.0
- Microsoft Visual C++, 32-bit Professional Edition 6.0
- Microsoft Visual C++, 32-bit Learning Edition 6.0
This article was previously published under Q216461 SYMPTOMS
If you create an MFC AppWizard-generated ActiveX document container, insert a Microsoft Word document or Excel Spreadsheet, and move a toolbar from the top to the left side of the window, without dragging the toolbar through the main window, the toolbar will cover part of the document.
CAUSE
This problem is caused by CFrameWnd::RecalcLayout() not being called when the toolbar is docked on the left side of the frame window.
RESOLUTION
Force CFrameWnd::RecalcLayout() to be called from the OnShowControlBars() function of the COleDocObjectItem-derived class. Perform the following steps to do this: - Add the declaration of OnShowControlBars() to the COleDocObjectItem-derived class, which is declared in the Cntritem.h file:
virtual BOOL OnShowControlBars(CFrameWnd*, BOOL);
- Implement OnShowControlBars() of the COleDocObjectItem-derived class in theCntritem.cpp file:
BOOL CAXContainerCntrItem::OnShowControlBars(CFrameWnd* pFrameWnd, BOOL bShow)
{
BOOL bResult = COleDocObjectItem::OnShowControlBars(pFrameWnd, bShow);
if(pFrameWnd->m_nIdleFlags & CFrameWnd::idleLayout)
pFrameWnd->RecalcLayout();
return bResult;
}
STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. REFERENCES
(c) Microsoft Corporation 1999, All Rights Reserved. Contributions by Bret Bentzinger, Microsoft Corporation.
Modification Type: | Major | Last Reviewed: | 1/6/2004 |
---|
Keywords: | kbActiveDocs kbBug kbContainer kbpending kbToolbar KbUIDesign KB216461 kbAudDeveloper |
---|
|