FIX: Framer Sample Does Not Handle Activation Correctly
Article ID: 160920
Article Last Modified on 10/2/2003
APPLIES TO
- Microsoft Internet Explorer 3.0
- Microsoft Internet Explorer 4.0 128-Bit Edition
- Microsoft Internet Explorer 4.01 Service Pack 2
This article was previously published under Q160920
SYMPTOMS
The Framer sample that comes with the ActiveX SDK does not handle
Wm_Activateapp. As a result, the contained DocObject is unable to determine
if the container is active or not. This becomes a problem when, for
example, Word is started within Framer and outside Framer. Actions that you
perform in the contained instance of Word, such as bringing up a dialog
box, actually occur in the standalone instance instead.
RESOLUTION
The solution to this problem involves notifying the contained DocObject of
activation changes by calling
IOleInPlaceActiveObject::OnFrameWindowActivate() and passing as a parameter
True if framer is activating and False if it is deactivating. The following
code can be added to Framer.cpp in the FrameWndProc function to handle
this:
case WM_ACTIVATEAPP:
if (NULL != pFR->m_pIOleIPActiveObject)
{
HRESULT hr;
hr = pFR->m_pIOleIPActiveObject->OnFrameWindowActivate((BOOL)wParam);
}
break;
STATUS
Microsoft has confirmed this to be a problem in the Framer sample supplied
with the ActiveX SDK. This problem has been fixed in the version of the
Framer sample provided with the Internet Client SDK for Internet Explorer
4.0.
Keywords: kbbug kbfix KB160920