Partager via


COleClientItem::OnGetWindowContext

Called by the framework when an item is activated in place.

virtual BOOL OnGetWindowContext(
   CFrameWnd** ppMainFrame,
   CFrameWnd** ppDocFrame,
   LPOLEINPLACEFRAMEINFO lpFrameInfo 
);

Parameters

  • ppMainFrame
    Pointer to a pointer to the main frame window.

  • ppDocFrame
    Pointer to a pointer to the document frame window.

  • lpFrameInfo
    Pointer to an OLEINPLACEFRAMEINFO structure that will receive frame window information.

Return Value

Nonzero if successful; otherwise 0.

Remarks

This function is used to retrieve information about the OLE item's parent window.

If the container is an MDI application, the default implementation returns a pointer to the CMDIFrameWnd object in ppMainFrame and a pointer to the active CMDIChildWnd object in ppDocFrame. If the container is an SDI application, the default implementation returns a pointer to the CFrameWnd object in ppMainFrame and returns NULL in ppDocFrame. The default implementation also fills in the members of lpFrameInfo.

Override this function only if the default implementation does not suit your application; for example, if your application has a user-interface paradigm that differs from SDI or MDI. This is an advanced overridable.

For more information, see IOleInPlaceSite::GetWindowContext and the OLEINPLACEFRAMEINFO structure in the Windows SDK.

Requirements

Header: afxole.h

See Also

Concepts

COleClientItem Class

COleClientItem Members

Hierarchy Chart