IOleInPlaceActiveObjectImpl Class

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at IOleInPlaceActiveObjectImpl Class.

This class provides methods for assisting communication between an in-place control and its container.

System_CAPS_ICON_important.jpg Important

This class and its members cannot be used in applications that execute in the Windows Runtime.

template<class T>
class IOleInPlaceActiveObjectImpl

Parameters

T
Your class, derived from IOleInPlaceActiveObjectImpl.

Public Methods

NameDescription
IOleInPlaceActiveObjectImpl::ContextSensitiveHelpEnables context-sensitive help. The ATL implementation returns E_NOTIMPL.
IOleInPlaceActiveObjectImpl::EnableModelessEnables modeless dialog boxes. The ATL implementation returns S_OK.
IOleInPlaceActiveObjectImpl::GetWindowGets a window handle.
IOleInPlaceActiveObjectImpl::OnDocWindowActivateNotifies the control when the container's document window is activated or deactivated. The ATL implementation returns S_OK.
IOleInPlaceActiveObjectImpl::OnFrameWindowActivateNotifies the control when the container's top-level frame window is activated or deactivated. The ATL implementation returns
IOleInPlaceActiveObjectImpl::ResizeBorderInforms the control it needs to resize its borders. The ATL implementation returns S_OK.
IOleInPlaceActiveObjectImpl::TranslateAcceleratorProcesses menu accelerator-key messages from the container. The ATL implementation returns E_NOTIMPL.

The IOleInPlaceActiveObject interface assists communication between an in-place control and its container; for example, communicating the active state of the control and container, and informing the control it needs to resize itself. Class IOleInPlaceActiveObjectImpl provides a default implementation of IOleInPlaceActiveObject and supports IUnknown by sending information to the dump device in debug builds.

Related Articles ATL Tutorial, Creating an ATL Project

IOleInPlaceActiveObject

IOleInPlaceActiveObjectImpl

Header: atlctl.h

Enables context-sensitive help.

HRESULT ContextSensitiveHelp(BOOL fEnterMode);

Return Value

Returns E_NOTIMPL.

Remarks

See IOleWindow::ContextSensitiveHelp in the Windows SDK.

Enables modeless dialog boxes.

HRESULT EnableModeless(BOOL fEnable);

Return Value

Returns S_OK.

Remarks

See IOleInPlaceActiveObject::EnableModeless in the Windows SDK.

The container calls this function to get the window handle of the control.

HRESULT GetWindow(HWND* phwnd);

Remarks

Some containers will not work with a control that has been windowless, even if it is currently windowed. In ATL's implementation, if the CComControl::m_bWasOnceWindowless data member is TRUE, the function returns E_FAIL. Otherwise, if * phwnd is not NULL, GetWindow assigns phwnd to the control class's data member m_hWnd and returns S_OK.

See IOleWindow::GetWindow in the Windows SDK.

Notifies the control when the container's document window is activated or deactivated.

HRESULT OnDocWindowActivate(BOOL fActivate);

Return Value

Returns S_OK.

Remarks

See IOleInPlaceActiveObject::OnDocWindowActivate in the Windows SDK.

Notifies the control when the container's top-level frame window is activated or deactivated.

HRESULT OnFrameWindowActivate(BOOL fActivate);

Return Value

Returns S_OK.

Remarks

See IOleInPlaceActiveObject::OnFrameWindowActivate in the Windows SDK.

Informs the control it needs to resize its borders.

HRESULT ResizeBorder(
    LPRECT prcBorder,
    IOleInPlaceUIWindow* pUIWindow,
    BOOL fFrameWindow);

Return Value

Returns S_OK.

Remarks

See IOleInPlaceActiveObject::ResizeBorder in the Windows SDK.

Processes menu accelerator-key messages from the container.

HRESULT TranslateAccelerator(LPMSG lpmsg);

Return Value

This method supports the following return values:

S_OK if the message was translated successfully.

S_FALSE if the message was not translated.

Remarks

See IOleInPlaceActiveObject::TranslateAccelerator in the Windows SDK.

CComControl Class
ActiveX Controls Interfaces
Class Overview

Show: