Home COM GDI+ WebBrowser Data Access

IViewObject2 Interface

 

IID_IViewObject2

{00000127-0000-0000-C000-000000000046}

 

 

The IViewObject2 interface is an extension to the IViewObject interface which returns the size of the drawing for a given view of an object. You can prevent the object from being run if it isn't already running by calling this method instead of IOleObject::GetExtent.

 

Like the IViewObject interface, IViewObject2 cannot be marshaled to another process. This is because device contexts are only effective in the context of one process.

 

The OLE-provided default implementation provides the size of the object in the cache.

 

A container application or object handler calls the GetExtent method in the IViewObject2 interface to get the object's size from its cache.

 

 

Methods in VTable order

IUnknown Methods

Description

QueryInterface

Returns pointers to supported interfaces.

AddRef

Increments reference count.

Release

Decrements reference count.

IViewObject Methods

Description

Draw

Draws a representation of the object onto a device context.

GetColorSet

Returns the logical palette the object uses for drawing.

Freeze

Freezes the drawn representation of an object so it will not change until a subsequent Unfreeze.

Unfreeze

Unfreezes the drawn representation of an object.

SetAdvise

Sets up a connection between the view object and an advise sink so that the advise sink can receive notifications of changes in the view object.

Draw

Draws a representation of the object onto a device context.

IViewObject2 Method

Description

GetAdvise

Returns the information on the most recent SetAdvise.

 

Draw

 

FUNCTION IViewObject2_Draw ( _
  BYVAL pthis AS DWORD PTR, _
  BYVAL dwDrawAspect AS DWORD, _
  BYVAL lindex AS LONG, _
  BYVAL pvAspect AS DWORD, _
  BYREF ptd AS DVTARGETDEVICE, _
  BYVAL hdcTargetDev AS DWORD, _
  BYVAL hdcDraw AS DWORD, _
  BYREF lprcBounds AS RECTL, _
  BYREF lprcWBounds AS RECTL, _
  BYVAL pfnContinue AS DWORD, _
  BYVAL dwContinue AS DWORD _
  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[3] USING IViewObject2_Draw (pthis, dwDrawAspect, lIndex, pvAspect, ptd, hdcTargetDev, hdcDraw, lprcBounds, lprcWBounds, pfnContinue, dwContinue) TO HRESULT
  FUNCTION = HRESULT


END FUNCTION

 

 

GetColorSet

 

FUNCTION IViewObject2_GetColorSet ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL dwAspect AS DWORD _

, BYVAL lindex AS LONG _

, BYVAL pvAspect AS DWORD _

, BYREF ptd AS DVTARGETDEVICE _

, BYVAL hdcTargetDev AS DWORD _

, BYREF ppColorSet AS DWORD _

  ) AS LONG
 

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[4] USING IViewObject2_GetColorSet (pthis, dwAspect, lIndex, pvAspect, ptd, hdcTargetDev, ppColorSet) TO HRESULT
  FUNCTION = HRESULT


END FUNCTION

 

 

Freeze

 

FUNCTION IViewObject2_Freeze ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL dwAspect AS DWORD _

, BYVAL lindex AS LONG _

, BYVAL pvAspect AS DWORD _

, BYREF pdwFreeze AS DWORD _

  ) AS LONG
 

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[5] USING IViewObject2_Freeze (pthis, dwAspect, lIndex, pvAspect, pdwFreeze) TO HRESULT
  FUNCTION = HRESULT


END FUNCTION

 

 

Unfreeze

 

FUNCTION IViewObject2_Unfreeze ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL dwFreeze AS DWORD _

  ) AS LONG
 

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[6] USING IViewObject2_Unfreeze (pthis, dwFreeze) TO HRESULT
  FUNCTION = HRESULT


END FUNCTION

 

 

SetAdvise

 

FUNCTION IViewObject2_SetAdvise ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL aspects AS DWORD _

, BYVAL advf AS DWORD _

, BYVAL pAdvSink AS DWORD _

  ) AS LONG
 

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[7] USING IViewObject2_SetAdvise (pthis, aspects, advf, pAdvSink) TO HRESULT
  FUNCTION = HRESULT


END FUNCTION

 

 

GetAdvise

 

FUNCTION IViewObject2_GetAdvise ( _

  BYVAL pthis AS DWORD PTR _

, BYREF aspects AS DWORD _

, BYREF advf AS DWORD _

, BYREF ppAdvSink AS DWORD _

  ) AS LONG
 

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[8] USING IViewObject2_GetAdvise (pthis, aspects, advf, ppAdvSink) TO HRESULT
  FUNCTION = HRESULT


END FUNCTION

 

 

GetExtent

 

FUNCTION IViewObject2_GetExtent ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL dwAspect AS DWORD _

, BYVAL lindex AS LONG _

, BYREF ptd AS DVTARGETDEVICE _

, BYREF lpsizel AS SIZEL _

  ) AS LONG
 

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[9] USING IViewObject2_GetExtent (pthis, dwAspect, lindex, ptd, lpsizel) TO HRESULT
  FUNCTION = HRESULT

 

END FUNCTION

 

 

Page last updated on Monday, 03 April 2006 20:33:57 +0200