COleIPFrameWndEx Class

The COleIPFrameWndEx class implements an OLE container that supports MFC. You must derive the in-place frame window class for your application from the COleIPFrameWndEx class, instead of deriving it from the COleIPFrameWndclass.

class COleIPFrameWndEx : public COleIPFrameWnd

Public Methods

Name

Description

COleIPFrameWndEx::AddDockSite

 

COleIPFrameWndEx::AddPane

 

COleIPFrameWndEx::AdjustDockingLayout

 

COleIPFrameWndEx::DockPane

 

COleIPFrameWndEx::DockPaneLeftOf

Docks one pane to the left of another pane.

COleIPFrameWndEx::EnableAutoHidePanes

 

COleIPFrameWndEx::EnableDocking

 

COleIPFrameWndEx::EnablePaneMenu

 

COleIPFrameWndEx::GetActivePopup

Returns a pointer to the currently displayed popup menu.

COleIPFrameWndEx::GetContainerFrameWindow

 

COleIPFrameWndEx::GetDefaultResId

Returns the resource ID of the frame window that you specified when the window was loaded.

COleIPFrameWndEx::GetDockFrame

 

COleIPFrameWndEx::GetDockingManager

 

COleIPFrameWndEx::GetMainFrame

 

COleIPFrameWndEx::GetMenuBar

Returns a pointer to the menu bar object attached to the frame window.

COleIPFrameWndEx::GetPane

 

COleIPFrameWndEx::GetTearOffBars

Returns a list of pane objects that are in a tear-off state.

COleIPFrameWndEx::GetToolbarButtonToolTipText

Called by the framework before the tooltip for a button is displayed.

COleIPFrameWndEx::InsertPane

 

COleIPFrameWndEx::IsMenuBarAvailable

Determines whether the pointer to the menu bar object is not NULL.

COleIPFrameWndEx::IsPointNearDockSite

 

COleIPFrameWndEx::LoadFrame

  (Overrides COleIPFrameWnd::LoadFrame.)

COleIPFrameWndEx::OnCloseDockingPane

 

COleIPFrameWndEx::OnCloseMiniFrame

 

COleIPFrameWndEx::OnClosePopupMenu

Called by the framework when an active pop-up menu processes a WM_DESTROY message.

COleIPFrameWndEx::OnCmdMsg

  (Overrides CFrameWnd::OnCmdMsg.)

COleIPFrameWndEx::OnDrawMenuImage

Called by the framework when the image associated with a menu item is drawn.

COleIPFrameWndEx::OnDrawMenuLogo

Called by the framework when a CMFCPopupMenuobject processes a WM_PAINT message.

COleIPFrameWndEx::OnMenuButtonToolHitTest

Called by the framework when a CMFCToolBarButtonobject processes WM_NCHITTEST message.

COleIPFrameWndEx::OnMoveMiniFrame

 

COleIPFrameWndEx::OnSetPreviewMode

Call this member function to set the application's main frame window into and out of print-preview mode. (Overrides CFrameWnd::OnSetPreviewMode.)

COleIPFrameWndEx::OnShowCustomizePane

 

COleIPFrameWndEx::OnShowPanes

 

COleIPFrameWndEx::OnShowPopupMenu

Called by the framework when a pop-up menu is activated.

COleIPFrameWndEx::OnTearOffMenu

Called by the framework when a menu that has a tear-off bar is activated.

COleIPFrameWndEx::PaneFromPoint

 

COleIPFrameWndEx::PreTranslateMessage

  (Overrides COleIPFrameWnd::PreTranslateMessage.)

COleIPFrameWndEx::RecalcLayout

  (Overrides COleIPFrameWnd::RecalcLayout.)

COleIPFrameWndEx::RemovePaneFromDockManager

 

COleIPFrameWndEx::SetDockState

Applies the specified docking state to the panes that belong to the frame window.

COleIPFrameWndEx::SetupToolbarMenu

Modifies a toolbar object by searching for dummy items and replacing them with the specified user-defined items.

COleIPFrameWndEx::ShowPane

 

Protected Methods

Name

Description

COleIPFrameWndEx::InitUserToobars

Tells the framework to initialize a range of control IDs that are assigned to user-defined toolbars.

The following example demonstrates how to subclass an instance of the COleIPFrameWndEx class and over ride its methods. The example shows how to over ride the OnDestory method, the RepositionFrame method, the RecalcLayout method, and the CalcWindowRect method. This code snippet is part of the Word Pad sample.


void CInPlaceFrame::OnDestroy()
{
	m_wndToolBar.DestroyWindow();
	m_wndFormatBar.DestroyWindow();
	COleIPFrameWndEx::OnDestroy();
}

void CInPlaceFrame::RepositionFrame(LPCRECT lpPosRect, LPCRECT lpClipRect)
{
	CRect rectNew = lpPosRect;
	rectNew.left -= HORZ_TEXTOFFSET;
	rectNew.top -= VERT_TEXTOFFSET;
	m_wndResizeBar.BringWindowToTop();
	COleIPFrameWndEx::RepositionFrame(&rectNew, lpClipRect);
	CWnd* pWnd = GetActiveView();
	if (pWnd != NULL)
		pWnd->BringWindowToTop();
	m_wndRulerBar.BringWindowToTop();
}

void CInPlaceFrame::RecalcLayout(BOOL bNotify)
{
	if (m_wndResizeBar.m_hWnd != NULL)
		m_wndResizeBar.BringWindowToTop();
	COleIPFrameWndEx::RecalcLayout(bNotify);
	CWnd* pWnd = GetActiveView();
	if (pWnd != NULL)
		pWnd->BringWindowToTop();
	if (m_wndRulerBar.m_hWnd != NULL)
		m_wndRulerBar.BringWindowToTop();

	// at least 12 pt region plus ruler if it exists
	CDisplayIC dc;
	CSize size;
	size.cy = MulDiv(12, dc.GetDeviceCaps(LOGPIXELSY), 72)+1;
	size.cx = dc.GetDeviceCaps(LOGPIXELSX)/4; // 1/4"
	size.cx += HORZ_TEXTOFFSET; //adjust for offset
	size.cy += VERT_TEXTOFFSET;
	if (m_wndRulerBar.m_hWnd != NULL && m_wndRulerBar.IsVisible())
	{
		CRect rect;
		m_wndRulerBar.GetWindowRect(&rect);
		size.cy += rect.Height();
	}
	m_wndResizeBar.SetMinSize(size);
}

void CInPlaceFrame::CalcWindowRect(LPRECT lpClientRect, UINT nAdjustType)
{
	COleIPFrameWndEx::CalcWindowRect(lpClientRect, nAdjustType);
}


CObject

   CCmdTarget

      CWnd

         CFrameWnd

            COleIPFrameWnd

               COleIPFrameWndEx

Header: afxoleipframewndex.h

Community Additions

ADD
Show: