Microsoft KB Archive/177239

= PRB: Toolbar removed from Active Document in a frame in IE4 =

Article ID: 177239

Article Last Modified on 6/18/2001

-

APPLIES TO


 * Microsoft Internet Explorer 4.0 128-Bit Edition
 * Microsoft Foundation Class Library 4.2

-



This article was previously published under Q177239



SYMPTOMS
When an MFC Active Document is inserted into a frame in Internet Explorer 4.0, the toolbar is removed from the Active Document when focus is set to another frame. Even when focus is set back to the frame that contains the Active Document, the toolbar does not reappear.



CAUSE
Active Documents are UI Deactivated when focus is set to another frame, but MFC-based Active Documents are not automatically UI Activated when focus is set back to the frame containing the document.



STATUS
This behavior is by design.



MORE INFORMATION
In order for the toolbar to reappear when the focus is set to the frame containing the Active Document, you must override CWnd::OnMouseActivate in your CView-derived class and call COleServerDoc::ActivateInPlace.

Here is the code that is needed to override CWnd::OnMouseActivate.

MyView.h
afx_msg int OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest,                              UINT message);

MyView.cpp
BEGIN_MESSAGE_MAP(CMyView, CView) ...     ON_WM_MOUSEACTIVATE ...  END_MESSAGE_MAP

int CMyView::OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest,                               UINT message) {     COleServerDoc* pDoc = (COleServerDoc*)GetDocument; pDoc->ActivateInPlace;

return CView::OnMouseActivate(pDesktopWnd, nHitTest, message); }

Keywords: kbprb KB177239

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.