FIX: Framer Sample Does Not Handle Activation Correctly (160920)



The information in this article applies to:

  • Microsoft Internet Explorer (Programming) 3.0
  • Microsoft Internet Explorer (Programming) 4.0
  • Microsoft Internet Explorer (Programming) 4.01

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.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Start Framer (\Inetsdk\Samples\Framer\Debug\Framer).
  2. Load a Word document into Framer with File->Open (for example, \Inetsdk\Specs\Asynchronous Storage.doc).
  3. Start a standalone copy of Word.
  4. Choose View->Toolbars from the contained word instance, and the dialog box comes up in the stand alone instance. If you change the Toolbar settings, notice that the changes are also reflected in the standalone instance of Word.

Modification Type:MajorLast Reviewed:10/2/2003
Keywords:kbbug kbfix KB160920