template< class T >
class IViewObjectExImpl
Parameters
T Your class, derived from IViewObjectExImpl.
The IViewObject, IViewObject2, and IViewObjectEx interfaces enable a control to display itself directly, and to create and manage an advise sink to notify the container of changes in the control display. The IViewObjectEx interface provides support for extended control features such as flicker-free drawing, non-rectangular and transparent controls, and hit-testing (for example, how close a mouse click must be to be considered on the control). Class IViewObjectExImpl provides a default implementation of these interfaces 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
IViewObject Methods | |
Draw | Draws a representation of the control onto a device context. |
Freeze | Freezes the drawn representation of a control so that it won't change until an Unfreeze. The ATL implementation returns E_NOTIMPL. |
GetAdvise | Returns information on the most recent SetAdvise. |
GetColorSet | Returns the logical palette used by the control for drawing. The ATL implementation returns E_NOTIMPL. |
SetAdvise | Sets up an advise sink to receive notifications of changes in the view of the control. |
Unfreeze | Unfreezes the drawn representation of the control. The ATL implementation returns E_NOTIMPL. |
IViewObject2 Methods | |
GetExtent | Retrieves the size of the control from the cache. |
IViewObjectEx Methods | |
GetNaturalExtent | Provides sizing hints from the container for the object to use as the user resizes it. The ATL implementation returns E_NOTIMPL. |
GetRect | Returns a rectangle describing a requested drawing aspect. The ATL implementation returns E_NOTIMPL. |
GetViewStatus | Returns information about the opacity of the object, and what drawing aspects are supported. |
QueryHitPoint | Indicates whether a point is within a given drawing aspect of an object. |
QueryHitRect | Indicates whether any point in a rectangle is within a given drawing aspect of an object. |
HRESULT Draw( DWORD dwDrawAspect, LONG lindex, void* pvAspect, DVTARGETDEVICE* ptd, HDC hicTargetDev, LPCRECTL prcBounds, LPCRECTL prcWBounds, BOOL(_stdcall * pfnContinue) (DWORD dwContinue), DWORD dwContinue );
See IViewObject::Draw in the Win32 SDK.
Remarks
This method calls OnDrawAdvanced which in turn calls your control class's OnDraw method. A default OnDraw method is automatically added to your control class when you create your control with the ATL Object Wizard. The default OnDraw draws a rectangle with the label "ATL 2.0".
IViewObjectExImpl Overview | Class Members
See Also CComControl::OnDraw, CComControl::OnDrawAdvanced
HRESULT Freeze( DWORD dwAspect, LONG lindex, void* pvAspect, DWORD* pdwFreeze );
See IViewObject::Freeze in the Win32 SDK.
Remarks
Returns E_NOTIMPL.
IViewObjectExImpl Overview | Class Members
HRESULT GetAdvise( DWORD* pAspects, DWORD* pAdvf, IAdviseSink** ppAdvSink );
See IViewObject::GetAdvise in the Win32 SDK.
Remarks
Retrieves an existing advisory sink connection on the control if there is one. The advisory sink is stored in the control class data member m_spAdviseSink.
IIViewObjectExImpl Overview | Class Members
See Also IViewObjectExImpl::SetAdvise
HRESULT GetColorSet( DWORD dwAspect, LONG lindex, void* pvAspect, DVTARGETDEVICE* ptd, HDC hicTargetDevice, LOGPALETTE** ppColorSet );
See IViewObject::GetColorSet in the Win32 SDK.
Remarks
Returns E_NOTIMPL.
IViewObjectExImpl Overview | Class Members
HRESULT GetExtent( DWORD dwDrawAspect, LONG lindex, DVTARGETDEVICE* ptd, LPSIZEL* lpsizel );
See IViewObject2::GetExtent in the Win32 SDK.
Remarks
Retrieves the control's display size in HIMETRIC units (0.01 millimeter per unit) from the control class data member m_sizeExtent.
IViewObjectExImpl Overview | Class Members
HRESULT GetNaturalExtent( DWORD dwAspect, LONG lindex, DVTARGETDEVICE* ptd, HDC hicTargetDevice, DVEXTENTINFO* pExtentInfo, LPSIZEL psizel );
See IViewObjectEx::GetNaturalExtentt in the Win32 SDK.
Remarks
If dwAspect is DVASPECT_CONTENT and pExtentInfo->deExtentMode is DVEXTENT_CONTENT, sets *psizel to the control class's data member m_sizeNatural.
IViewObjectExImpl Overview | Class Members
HRESULT GetRect( DWORD dwAspect, LPRECTL pRect );
See IViewObjectEx::GetRect in the Win32 SDK.
Remarks
Returns E_NOTIMPL.
IViewObjectExImpl Overview | Class Members
HRESULT GetViewStatus( DWORD* pdwStatus );
See IViewObjectEx::GetViewStatus in the Win32 SDK.
Remarks
By default, ATL sets pdwStatus to indicate the control supports VIEWSTATUS_OPAQUE (possible values are in the VIEWSTATUS enumeration in the Win32 SDK).
IViewObjectExImpl Overview | Class Members
HRESULT QueryHitPoint( DWORD dwAspect, LPCRECT pRectBounds, POINT ptlLoc, LONG lCloseHit, DWORD* pHitResult );
See IViewObjectEx::QueryHitPoint in the Win32 SDK.
Remarks
Checks if the specified point is in the specified rectangle and returns a HITRESULT value in pHitResult. The value can be either HITRESULT_HIT or HITRESULT_OUTSIDE.
If dwAspect equals DVASPECT_CONTENT, the method returns S_OK. Otherwise, the method returns E_FAIL.
IViewObjectExImpl Overview | Class Members
See Also IViewObjectExImpl::QueryHitRect
HRESULT QueryHitRect( DWORD dwAspect, LPCRECT pRectBounds, LPRECT prcLoc, LONG lCloseHit, DWORD* pHitResult );
See IViewObjectEx::QueryHitRect in the Win32 SDK.
Remarks
Checks whether the control's display rectangle overlaps any point in the specified location rectangle and returns a HITRESULT value in pHitResult. The value can be either HITRESULT_HIT or HITRESULT_OUTSIDE.
If dwAspect equals DVASPECT_CONTENT), the method returns S_OK. Otherwise, the method returns E_FAIL.
IViewObjectExImpl Overview | Class Members
See Also IViewObjectExImpl::QueryHitPoint
HRESULT SetAdvise( DWORD aspects, DWORD advf, IAdviseSink* pAdvSink );
See IViewObject::SetAdvise in the Win32 SDK.
Remarks
Sets up a connection between the control and an advise sink so that the sink can be notified about changes in the control's view. The pointer to the IAdviseSink interface on the advise sink is stored in the control class data member m_spAdviseSink.
IViewObjectExImpl Overview | Class Members
See Also IViewObjectExImpl::GetAdvise
HRESULT Unfreeze( DWORD dwFreeze );
See IViewObject::Unfreeze in the Win32 SDK.
Remarks
Returns E_NOTIMPL.