template< class T >
class IOleObjectImpl
Parameters
T Your class, derived from IOleObjectImpl.
The IOleObject interface is the principle interface through which a container communicates with a controlonality to its container. Class IOleObjectImpl provides a default implementation of this interface and implements IUnknown by sending information to the dump device in debug builds.
Related Articles ATL Tutorial, Creating an ATL Project
#include <atlctl.h>
See Also CComControl, ActiveX Controls Interfaces in the Win32 SDK
IOleObject Methods | |
Advise | Establishes an advisory connection with the control. |
Close | Changes the control state from running to loaded. |
DoVerb | Tells the control to perform one of its enumerated actions. |
EnumAdvise | Enumerates the control's advisory connections. |
EnumVerbs | Enumerates actions for the control. |
GetClientSite | Retrieves the control's client site. |
GetClipboardData | Retrieves data from the Clipboard. The ATL implementation returns E_NOTIMPL. |
GetExtent | Retrieves the extent of the control's display area. |
GetMiscStatus | Retrieves the status of the control. |
GetMoniker | Retrieves the control's moniker. The ATL implementation returns E_NOTIMPL. |
GetUserClassID | Retrieves the control's class identifier. |
GetUserType | Retrieves the control's user-type name. |
InitFromData | Initializes the control from selected data. The ATL implementation returns E_NOTIMPL. |
IsUpToDate | Checks if the control is up to date. The ATL implementation returns S_OK. |
SetClientSite | Tells the control about its client site in the container. |
SetColorScheme | Recommends a color scheme to the control's application, if any. The ATL implementation returns E_NOTIMPL. |
SetExtent | Sets the extent of the control's display area. |
SetHostNames | Tells the control the names of the container application and container document. |
SetMoniker | Tells the control what its moniker is. The ATL implementation returns E_NOTIMPL. |
Unadvise | Destroys an advisory connection with the control. |
Update | Updates the control. The ATL implementation returns S_OK. |
DoVerb Helper Methods | |
DoVerbDiscardUndo | Tells the control to discard any undo state it is maintaining. |
DoVerbHide | Tells the control to remove its user interface from view. |
DoVerbInPlaceActivate | Runs the control and intalls its window, but does not install the control's user interface. |
DoVerbOpen | Causes the control to be open-edited in a separate window. |
DoVerbPrimary | Performs the specified action when the user double-clicks the control. The control defines the action, usually to activate the control in-place. |
DoVerbShow | Shows a newly inserted control to the user. |
DoVerbUIActivate | Activates the control in-place and shows the control's user interface, such as menus and toolbars. |
HRESULT Advise( IAdviseSink* pAdvSink, DWORD* pdwConnection );
See IOleObject::Advise in the Win32 SDK.
Remarks
If successful, the IAdviseSink pointer is stored in the control class's m_spOleAdviseHolder data member.
IOleObjectImpl Overview | Class Members
See Also CComControl::m_spOleAdviseHolder, IOleObjectImpl::Unadvise
HRESULT Close( DWORD dwSaveOption );
See IOleObject::Close in the Win32 SDK.
Remarks
Changes the control from the running to the loaded state. Deactivates the control and destroys the control window if it exists. If the control class data member m_bRequiresSave is TRUE and the dwSaveOption parameter is either OLECLOSE_SAVEIFDIRTY or OLECLOSE_PROMPTSAVE, the control properties are saved before closing.
The pointers held in the control class data members m_spInPlaceSite and m_spAdviseSink are released, and the data members m_bNegotiatedWnd, m_bWndless, and m_bInPlaceSiteEx are set to FALSE.
IOleObjectImpl Overview | Class Members
HRESULT DoVerb( LONG iVerb, LPMSG lpmsg, IOleClientSite* pActiveSite, LONG lindex, HWND hwndParent, LPCRECT lprcPosRect );
See IOleObject::DoVerb in the Win32 SDK.
Remarks
The ATL implementation of this function uses only the first parameter, iVerb. Depending on the value of iVerb, one of the ATL DoVerb helper functions is called as follows:
iVerb Value | DoVerb helper function called |
OLEIVERB_DISCARDUNDOSTATE | DoVerbDiscardUndo |
OLEIVERB_HIDE | DoVerbHide |
OLEIVERB_INPLACEACTIVATE | DoVerbInPlaceActivate |
OLEIVERB_OPEN | DoVerbOpen |
OLEIVERB_PRIMARY | DoVerbPrimary |
OLEIVERB_PROPERTIES | CComControl::DoVerbProperties |
OLEIVERB_SHOW | DoVerbShow |
OLEIVERB_UIACTIVATE | DoVerbUIActivate |
IOleObjectImpl Overview | Class Members
See Also IOleObject::EnumVerbs in the Win32 SDK.
HRESULT DoVerbDiscardUndo( LPCRECT prcPosRect, HWND hwndParent );
Return Value
Returns S_OK.
Parameters
prcPosRec [in] Pointer to the rectangle the container wants the control to draw into.
hwndParent [in] Handle of the window containing the control.
Remarks
The default implementation simply returns S_OK.
IOleObjectImpl Overview | Class Members
HRESULT DoVerbHide( LPCRECT prcPosRect, HWND hwndParent );
Return Value
Returns S_OK.
Parameters
prcPosRec [in] Pointer to the rectangle the container wants the control to draw into.
hwndParent [in] Handle of the window containing the control. Not used in the ATL implementation.
Remarks
Deactivates and removes the control's user interface, and hides the control.
IOleObjectImpl Overview | Class Members
See Also IOleObjectImpl::DoVerbShow
HRESULT DoVerbInPlaceActivate( LPCRECT prcPosRect, HWND hwndParent );
Return Value
One of the standard HRESULT values.
Parameters
prcPosRec [in] Pointer to the rectangle the container wants the control to draw into.
hwndParent [in] Handle of the window containing the control. Not used in the ATL implementation.
Remarks
Activates the control in place by calling CComControl::InPlaceActivate. Unless the control class's data member m_bWindowOnly is TRUE, DoVerbInPlaceActivate first attempts to activate the control as a windowless control (possible only if the container supports IOleInPlaceSiteWindowless). If that fails, the function attempts to activate the control with extended features (possible only if the container supports IOleInPlaceSiteEx). If that fails, the function attempts to activate the control with no extended features (possible only if the container supports IOleInPlaceSite). If activation succeeds, the function notifies the container the control has been activated.
IOleObjectImpl Overview | Class Members
See Also CComControl::InPlaceActivate, CComControl::m_bWindowOnly
HRESULT DoVerbOpen( LPCRECT prcPosRect, HWND hwndParent );
Return Value
Returns S_OK.
Parameters
prcPosRec [in] Pointer to the rectangle the container wants the control to draw into.
hwndParent [in] Handle of the window containing the control.
Remarks
The default implementation simply returns S_OK.
IOleObjectImpl Overview | Class Members
HRESULT DoVerbPrimary( LPCRECT prcPosRect, HWND hwndParent );
Return Value
One of the standard HRESULT values.
Parameters
prcPosRec [in] Pointer to the rectangle the container wants the control to draw into.
hwndParent [in] Handle of the window containing the control.
Remarks
Defines the action taken when the user double-clicks the control. By default, set to display the property pages. You can override this in your control class to invoke a different behavior on double-click; for example, play a video or go in-place active.
IOleObjectImpl Overview | Class Members
See Also CComControl::DoVerbProperties
HRESULT DoVerbShow( LPCRECT prcPosRect, HWND hwndParent );
Return Value
One of the standard HRESULT values.
Parameters
prcPosRec [in] Pointer to the rectangle the container wants the control to draw into.
hwndParent [in] Handle of the window containing the control. Not used in the ATL implementation.
Remarks
Tells the container to make the control visible.
IOleObjectImpl Overview | Class Members
See Also IOleObjectImpl::DoVerbHide
HRESULT DoVerbUIActivate( LPCRECT prcPosRect, HWND hwndParent );
Return Value
One of the standard HRESULT values.
Parameters
prcPosRec [in] Pointer to the rectangle the container wants the control to draw into.
hwndParent [in] Handle of the window containing the control. Not used in the ATL implementation.
Remarks
Activates the control's user interface and notifies the container that its menus are being replaced by composite menus.
IOleObjectImpl Overview | Class Members
See Also CComControl::InPlaceActivate, IOleObjectImpl::DoVerbInPlaceActivate
HRESULT EnumAdvise( IEnumSTATDATA** ppenumAdvise );
See IOleObject::EnumAdvise in the Win32 SDK.
Remarks
Supplies an enumeration of registered advisory connections for this control.
IOleObjectImpl Overview | Class Members
See Also IOleObjectImpl::EnumVerbs
HRESULT EnumVerbs( IEnumOLEVERB** ppEnumOleVerb );
See IOleObject::EnumVerbs in the Win32 SDK.
Remarks
Supplies an enumeration of registered actions (verbs) for this control by calling OleRegEnumVerbs. You can add verbs to your projects .rgs file. For example, see CircCtl.rgs in the CIRC sample.
IOleObjectImpl Overview | Class Members
See Also OleRegEnumVerbs in theWin32 SDK, IOleObjectImpl::EnumAdvise
HRESULT GetClientSite( IOleClientSite** ppClientSite );
See IOleObject::GetClientSite in the Win32 SDK.
Remarks
Puts the pointer in the control class data member m_spClientSite into ppClientSite and increments the reference count on the pointer.
IOleObjectImpl Overview | Class Members
See Also IOleObjectImpl::SetClientSite
HRESULT GetClipboardData( DWORD dwReserved, IData Object** ppDataObject );
See IOleObject::GetClipboardData in the Win32 SDK.
Remarks
Returns E_NOTIMPL.
IOleObjectImpl Overview | Class Members
HRESULT GetExtent( DWORD dwDrawAspect, SIZEL* psizel );
See IOleObject::GetExtent in the Win32 SDK.
Remarks
Retrieves a running control's display size in HIMETRIC units (0.01 millimeter per unit). The size is stored in the control class data member m_sizeExtent.
IOleObjectImpl Overview | Class Members
See Also IOleObjectImpl::SetExtent
HRESULT GetMiscStatus( DWORD dwAspect, DWORD* pdwStatus );
See IOleObject::GetMiscStatus in the Win32 SDK.
Remarks
Returns a pointer to registered status information for the control by calling OleRegGetMiscStatus. The status information includes behaviors supported by the control and presentation data. You can add status information to your project's .rgs file.
IOleObjectImpl Overview | Class Members
See Also OleRegGetMiscStatus in the Win32 SDK , IOleObjectImpl::EnumVerbs, IOleObjectImpl::GetUserType
HRESULT GetMoniker( DWORD dwAssign, DWORD dwWhichMoniker, IMoniker** ppmk );
See IOleObject::GetMoniker in the Win32 SDK.
Remarks
Returns E_NOTIMPL.
IOleObjectImpl Overview | Class Members
HRESULT GetUserClassID( CLSID* pClsid );
See IOleObject::GetUserClassID in the Win32 SDK.
Remarks
Returns the control's class identifier.
IOleObjectImpl Overview | Class Members
See Also IOleObjectImpl::GetUserType
HRESULT GetUserType( DWORD dwFormOfType, LPOLESTR* pszUserType );
See IOleObject::GetUserType in the Win32 SDK.
Remarks
Returns the control's user-type name by calling OleRegGetUserType. The user-type name is used for display in user-interfaces elements such as menus and dialog boxes. You can change the user-type name in your project's .rgs file.
IOleObjectImpl Overview | Class Members
See Also OleRegGetUserType in the Win32 SDK, IOleObjectImpl::GetUserClassID, IOleObjectImpl::GetMiscStatus, IOleObjectImpl::EnumVerbs
HRESULT InitFromData( IDataObject* pDataObject, BOOL fCreation, DWORD dwReserved );
See IOleObject::InitFromData in the Win32 SDK.
Remarks
Returns E_NOTIMPL.
IOleObjectImpl Overview | Class Members
HRESULT IsUpToDate( );
See IOleObject::IsUpToDate in the Win32 SDK.
Remarks
Returns S_OK.
IOleObjectImpl Overview | Class Members
HRESULT SetClientSite( IOleClientSite* pClientSite );
See IOleObject::SetClientSite in the Win32 SDK.
Remarks
Uses pClientSite as the pointer to the control's client site and stores pClientSite in the control class data member m_spClientSite. The method then returns S_OK.
IOleObjectImpl Overview | Class Members
See Also IOleObjectImpl::GetClientSite
HRESULT SetColorScheme( LOGPALETTE* pLogPal );
See IOleObject::SetColorScheme in the Win32 SDK.
Remarks
Returns E_NOTIMPL.
IOleObjectImpl Overview | Class Members
HRESULT SetExtent( DWORD dwDrawAspect, SIZEL* psizel );
See IOleObject::SetExtent in the Win32 SDK.
Remarks
If the control class data member m_bAutoSize is TRUE, this method returns E_FAIL because the control cannot be resized. Otherwise, SetExtent stores the value pointed to by psizel in the control class data member m_sizeExtent. This value is in HIMETRIC units (0.01 millimeter per unit).
If the control class data member m_bResizeNatural is TRUE, SetExtent also stores the value pointed to by psizel in the control class data member m_sizeNatural.
If the control class data member m_bRecomposeOnResize is TRUE, SetExtent calls SendOnDataChange and SendOnViewChange to notify all advisory sinks registered with the advise holder that the control size has changed.
IOleObjectImpl Overview | Class Members
See Also IOleObjectImpl::GetExtent, CComControl::SendOnDataChange, CComControl::SendOnViewChange
HRESULT SetHostNames( LPCOLESTR szContainerApp, LPCOLESTR szContainerObj );
See IOleObject::SetHostNames in the Win32 SDK.
Remarks
Returns S_OK.
IOleObjectImpl Overview | Class Members
HRESULT SetMoniker( DWORD dwAssign, DWORD dwWhichMoniker, IMoniker** ppmk );
See IOleObject::SetMoniker in the Win32 SDK.
Remarks
Returns E_NOTIMPL.
IOleObjectImpl Overview | Class Members
HRESULT Unadvise( DWORD dwConnection );
See IOleObject::Unadvise in the Win32 SDK.
Remarks
Deletes the advisory connection stored in the control class's m_spOleAdviseHolder data member.
IOleObjectImpl Overview | Class Members
See Also CComControl::m_spOleAdviseHolder, IOleObjectImpl::Advise
HRESULT Update( );
See IOleObject::Update in the Win32 SDK.
Remarks
Returns S_OK.