IDAView Interface

The IDAView interface handles tasks specific to a particular view.

You can access the view through the View property in DAViewerControl.

See IDA2View and IDA3View for more recent methods.

This interface inherits from IDispatch. Like pure COM interfaces, such as IUnknown, IDispatch exposes objects, methods, and properties to applications. Unlike IUnknown, IDispatch members are identified with human-readable names, not as vtable indexes. IDispatch interfaces don't perform as well as pure COM interfaces.

IDAView Methods

AddBvrToRun Adds a behavior to the run list when the behavior is not part of the model or returned from the notifier.
get_ClientSite Retrieves the pointer to IOleClientSite interface of the view.
get_CompositeDirectlyToTarget Retrieves the flag specifying the composition mode: whether to compose to the back buffer or directly to the target device.
get_DC Retrieves the handle of the device context (DC) in which the view will appear.
get_IDirectDrawSurface Retrieves the DirectDrawSurface object in which the view will appear.
get_Preferences Retrieves a pointer to the DAPreferences object for this view.
get_SimulationTime Retrieves the current simulation (tick) time.
get_Site Retrieves the pointer to the IDAViewSite interface of the view site for this view.
get_Window Retrieves the handle of the window in which to display the view.
OnFocus Notifies the view that it has focus.
OnKey Notifies the view that the user pressed a keyboard key.
OnMouseButton Notifies the view that the user clicked a mouse button.
OnMouseMove Notifies the view that the mouse pointer has moved.
PaletteChanged Sets a flag to inform the video driver whether the palette has changed.
put_ClientSite Specifies the pointer to IOleClientSite interface of the view.
put_CompositeDirectlyToTarget Sets the flag specifying the composition mode: whether to compose to the back buffer or directly to the target device.
put_DC Sets the handle of the device context (DC) in which the view will appear.
put_IDirectDrawSurface Sets the DirectDrawSurface in which the view will appear.
put_Site Specifies the pointer to the IDAViewSite interface of the view site for this view.
put_Window Sets the handle of the window in which to display the view.
QueryHitPoint Goes through the image or geometry objects in a view and retrieves the number hit.
RemoveRunningBvr Removes a behavior previously added with IDAView::AddBvrToRun from the view.
Render Renders the view.
RePaint Repaints the specified rectangle of this view.
SetClipRect Sets the clipping rectangle for this view.
SetViewport Sets the viewport for the view. A viewport is a rectangle in device space.
StartModel Starts rendering the animation model with the specified image and sound at the specified base start time.
StopModel Stops rendering of the current animation model.
Tick Tells the animation what time it is so that the view can be updated accordingly.

IDAView::AddBvrToRun


IDAView

Adds a behavior to the run list when the behavior is not part of the model or returned from the notifier. When the system starts the model, the view or notifier will retrieve these additional behaviors and run them with the same start time as the behaviors included in the model.

Syntax

HRESULT AddBvrToRun(
    IDABehavior *bvr,
    LONG *pId
);

Parameters

bvr
[in] Pointer to the DABehavior object to be added.
pID
[out] Pointer to an identifier for the added behavior. Use this identifier to remove the behavior from the view.

Return Value

Returns an HRESULT value that indicates the success of the method or the reason why it failed. This HRESULT depends on the implementation of the interface.

Remarks

You must use the pID identifier to remove the added behavior from the view by calling IDAView::RemoveRunningBvr. You cannot use the behavior itself as the identifier.

See Also

IDAView::RemoveRunningBvr

IDAView::get_ClientSite


IDAView

Retrieves a pointer to IOleClientSite interface of the view. When set, this interface enables imports from a relative file name by establishing an absolute URL base.

Syntax

HRESULT get_ClientSite(
    IOleClientSite **pClientSite
);

Parameters

pClientSite
[out] Address of a pointer to the IOleClientSite interface of the view.

Return Value

Returns an HRESULT value that indicates the success of the method or the reason why it failed. This HRESULT depends on the implementation of the interface.

Remarks

The IOleClientSite interface is the primary means by which an embedded object obtains information about the location and extent of its display site, its moniker, its user interface, and other resources provided by its container.

See Also

IDAView::put_ClientSite, IDAStatics::get_ClientSite

IDAView::get_CompositeDirectlyToTarget


IDAView

Retrieves the flag specifying the composition mode: whether to compose to the back buffer or directly to the target device.

Syntax

HRESULT get_CompositeDirectlyToTarget(
    VARIANT_BOOL *composeToTarget
);

Parameters

composeToTarget
[out] Pointer to the flag specifying the composition mode. If TRUE, the view is composed directly to the target device. If FALSE, the view is composed to the back buffer.

Return Value

Returns an HRESULT value that indicates the success of the method or the reason why it failed. This HRESULT depends on the implementation of the interface.

Remarks

The back buffer is a nonvisible surface that images can be drawn to while the primary surface displays the currently visible image.

See Also

IDAView::put_CompositeDirectlyToTarget

IDAView::get_DC


IDAView

Retrieves the handle of the device context (DC) in which the view will be displayed.

Syntax

HRESULT get_DC(
    HDC *dc
);

Parameters

dc
[out] Pointer to the handle of the device context (DC).

Return Value

Returns an HRESULT value that indicates the success of the method or the reason why it failed. This HRESULT depends on the implementation of the interface.

Remarks

The DC refers to a physical output device, its name, device driver, and other attributes. Methods contain a handle to a DC to include the attributes of the specified device. There are four types of DC: display (supports drawing operations on a video display terminal), printer (supports drawing operations on a printer or plotter), memory (supports drawing operations on a bitmap), and information (supports retrieval of device data).

See Also

IDAView::put_DC

IDAView::get_IDirectDrawSurface


IDAView

Retrieves the DirectDrawSurface in which the view will appear.

Syntax

HRESULT get_IDirectDrawSurface(
    IUnknown **ddsurf
);

Parameters

ddsurf
[out] Address of a pointer to the IUnknown of the DirectDrawSurface object.

Return Value

Returns an HRESULT value that indicates the success of the method or the reason why it failed. This HRESULT depends on the implementation of the interface.

See Also

IDAView::put_IDirectDrawSurface

IDAView::get_Preferences


IDAView

Retrieves a pointer to DAPreferences object for this view. You can use the DAPreferences object to provide explicit rendering and viewing preference settings to Microsoft® DirectAnimation®, such as the fill mode or the maximum frames per second.

Syntax

HRESULT get_Preferences(
    IDAPreferences **prefs
);

Parameters

prefs
[out] Address of a pointer to the IDAPreferences interface for this view.

Return Value

Returns an HRESULT value that indicates the success of the method or the reason why it failed. This HRESULT depends on the implementation of the interface.

See Also

PutPreference, GetPreference, Propagate

IDAView::get_SimulationTime


IDAView

Retrieves the current simulation time. The simulation time (in seconds) sets the time for subsequent rendering. It is reported to the view every time Tick is called so that the view can be updated accordingly. The actual elapsed time in the animation is the start time, set with StartModel, minus the simulation time.

Syntax

HRESULT get_SimulationTime( double *simTime );

Parameters

simTime
[in] Pointer to the currently set simulation time.

Return Value

Returns an HRESULT value that indicates the success of the method or the reason why it failed. This HRESULT depends on the implementation of the interface.

See Also

IDAView::Tick, IDAView::StartModel

IDAView::get_Site


IDAView

Retrieves a pointer to IDAViewSite interface of the view site for this view. When you create a view, you should also create a view site. DirectAnimation sends status information about the view to the view site.

Syntax

HRESULT get_Site(
    IDAViewSite **pViewSite
);

Parameters

pViewSite
[out] Address of a pointer to the IDAViewSite interface of the view site for this view.

Return Value

Returns an HRESULT value that indicates the success of the method or the reason why it failed. This HRESULT depends on the implementation of the interface.

See Also

IDAView::put_Site

IDAView::get_Window


IDAView

Retrieves the handle of the window in which the view will appear.

Syntax

HRESULT get_Window(
    LONG *hwnd
);

Parameters

hwnd
[out] Pointer to the handle of the window in which the view will appear.

Return Value

Returns an HRESULT value that indicates the success of the method or the reason why it failed. This HRESULT depends on the implementation of the interface.

See Also

IDAView::put_Window

IDAView::OnFocus


IDAView

Notifies the view that it has Windows® focus.

Syntax

HRESULT OnFocus(
    VARIANT_BOOL bHasFocus
);

Parameters

bHasFocus
[in] Flag that indicates whether the view has Windows® focus. TRUE if the view has the Windows® focus. FALSE if the view does not have focus.

Return Value

Returns an HRESULT value that indicates the success of the method or the reason why it failed. This HRESULT depends on the implementation of the interface.

Remarks

In the Microsoft Windows® environment, only one object can receive mouse clicks or keyboard input at any one time, and this object has the focus. The user or the application can set focus.

For an example of this method, see ctlhost.cpp in the Samples\Multimedia\DAnim\C++\Showcase\DragGeoCntrl directory.

IDAView::OnKey


IDAView

Notifies the view that the user pressed a keyboard key.

Syntax

HRESULT OnKey(
    double when,
    LONG key,
    VARIANT_BOOL bPressed,
    BYTE modifiers
);

Parameters

when
[in] Time the key was pressed. The time is relative to the simulation time set with Tick.
key
[in] Identifies the key pressed. Can be one or more of the following values.
DAKEY_ENDDAKEY_HOMEDAKEY_LEFT
DAKEY_UPDAKEY_RIGHTDAKEY_DOWN
DAKEY_INSERTDAKEY_DELETEDAKEY_NUMPAD0
DAKEY_NUMPAD1DAKEY_NUMPAD2DAKEY_NUMPAD3
DAKEY_NUMPAD4DAKEY_NUMPAD5DAKEY_NUMPAD6
DAKEY_NUMPAD7DAKEY_NUMPAD8DAKEY_NUMPAD9
DAKEY_MULTIPLYDAKEY_ATDDAKEY_SEPARATOR
DAKEY_SUBTRACT DAKEY_DECIMALDAKEY_DIVIDE
DAKEY_F1DAKEY_F2DAKEY_F3
DAKEY_F4DAKEY_F5DAKEY_F6
DAKEY_F7DAKEY_F8DAKEY_F9
DAKEY_F10DAKEY_F11DAKEY_F12
DAKEY_F13DAKEY_F14DAKEY_F15
DAKEY_F16DAKEY_F17DAKEY_F18
DAKEY_F19DAKEY_F20DAKEY_F21
DAKEY_F22DAKEY_F23DAKEY_F24
DAKEY_PGUPDAKEY_PGDN
bPressed
[in] Flag that indicates whether the key is pressed (down). TRUE if the key is pressed (down). FALSE if the key is not pressed (up).
modifiers
[in] Identifies other keyboard keys pressed, which can modify the meaning of the key being pressed. Can be one or more of the following values.
FlagDescriptionValue
DAEMOD_SHIFT_MASKthe SHIFT key0x01
DAEMOD_CTRL_MASKthe CTRL key0x02
DAEMOD_ALT_MASKthe ALT key0x04
DAEMOD_META_MASKthe META key0x08

Return Value

Returns an HRESULT value that indicates the success of the method or the reason why it failed. This HRESULT depends on the implementation of the interface.

Remarks

For an example of this method, see ctlhost.cpp in the Samples\Multimedia\DAnim\C++\Showcase\DragGeoCntrl directory.

IDAView::OnMouseButton


IDAView

Notifies the view that the user clicked a mouse button.

Syntax

HRESULT OnMouseButton(
    double when,
    LONG xPos,
    LONG yPos,
    BYTE button,
    VARIANT_BOOL bPressed,
    BYTE modifiers
);

Parameters

when
[in] Time the mouse button event occurred. The time is relative to the simulation time set with Tick.
xPos, yPos
[in] Mouse pointer position.
button
[in] Identifies the mouse button clicked. Can be one or more of the following values.
DA_MOUSE_BUTTON_LEFT - 0
DA_MOUSE_BUTTON_RIGHT - 1
DA_MOUSE_BUTTON_MIDDLE -2
bPressed
[in] Flag that indicates whether the mouse button is clicked (down). TRUE if the button is pressed (down). FALSE if the button is not pressed (up).
modifiers
[in] Identifies keyboard keys pressed, which can modify the meaning of the mouse button being pressed. Can be one or more of the following values.
FlagDescriptionValue
DAEMOD_SHIFT_MASKthe SHIFT key0x01
DAEMOD_CTRL_MASKthe CTRL key0x02
DAEMOD_ALT_MASKthe ALT key0x04
DAEMOD_META_MASKthe META key0x08

Return Value

Returns an HRESULT value that indicates the success of the method or the reason why it failed. This HRESULT depends on the implementation of the interface.

IDAView::OnMouseMove


IDAView

Notifies the view that the mouse pointer has moved.

Syntax

HRESULT OnMouseMove(
    double when,
    LONG xPos,
    LONG yPos,
    BYTE modifiers
);

Parameters

when
[in] Time the mouse pointer move occurred. The time is relative to the simulation time set with Tick.
xPos, yPos
[in] Mouse pointer position.
modifiers
[in] Identifies keyboard keys pressed, which can modify the meaning of the mouse movement. Can be one or more of the following values.
FlagDescriptionValue
DAEMOD_SHIFT_MASKthe SHIFT key0x01
DAEMOD_CTRL_MASKthe CTRL key0x02
DAEMOD_ALT_MASKthe ALT key0x04
DAEMOD_META_MASKthe META key0x08

Return Value

Returns an HRESULT value that indicates the success of the method or the reason why it failed. This HRESULT depends on the implementation of the interface.

IDAView::PaletteChanged


IDAView

Sets a flag to inform the video driver whether the palette has changed.

Syntax

HRESULT PaletteChanged(
    VARIANT_BOOL bNew
);

Parameters

bnew
[in] Flag indicating whether the palette has changed. If TRUE, the palette has changed. If FALSE, the palette has not changed.

Return Value

Returns an HRESULT value that indicates the success of the method or the reason why it failed. This HRESULT depends on the implementation of the interface.

IDAView::put_ClientSite


IDAView

Specifies the pointer to the IOleClientSite interface of the view. When set, this interface enables imports from a relative file name by establishing an absolute URL base.

Syntax

HRESULT put_ClientSite(
    IOleClientSite *pClientSite
);

Parameters

pClientSite
[in] Pointer to the IOleClientSite interface of the view.

Return Value

Returns an HRESULT value that indicates the success of the method or the reason why it failed. This HRESULT depends on the implementation of the interface.

Remarks

The IOleClientSite interface is the primary means by which an embedded object obtains information about the location and extent of its display site, its moniker, its user interface, and other resources provided by its container.

See Also

IDAView::get_ClientSite, IDAStatics::put_ClientSite

IDAView::put_CompositeDirectlyToTarget


IDAView

Sets the flag specifying the composition mode: whether to compose to the back buffer or directly to the target device.

Syntax

HRESULT put_CompositeDirectlyToTarget(
    VARIANT_BOOL composeToTarget
);

Parameters

composeToTarget
[in] Flag specifying the composition mode. If TRUE, the view is composed directly to the target device. If FALSE, the view is composed to the back buffer.

Return Value

Returns an HRESULT value that indicates the success of the method or the reason why it failed. This HRESULT depends on the implementation of the interface.

Remarks

For an example of this method, see the dxa.cpp file in the Samples\Multimedia\DAnim\C++\Showcase\Movie directory.

See Also

IDAView::get_CompositeDirectlyToTarget

IDAView::put_DC


IDAView

Sets the handle of the device context (DC) in which the view will appear.

Syntax

HRESULT put_DC(
    HDC dc
);

Parameters

dc
[in] Handle of the DC.

Return Value

Returns an HRESULT value that indicates the success of the method or the reason why it failed. This HRESULT depends on the implementation of the interface.

See Also

IDAView::get_DC

IDAView::put_IDirectDrawSurface


IDAView

Sets the DirectDrawSurface in which the view will appear.

Syntax

HRESULT put_IDirectDrawSurface(
    IUnknown *ddsurf
);

Parameters

ddsurf
[in] Pointer to the IUnknown interface of the DirectDrawSurface object.

Return Value

Returns an HRESULT value that indicates the success of the method or the reason why it failed. This HRESULT depends on the implementation of the interface.

Remarks

For an example of this method, see the dxa.cpp file in the Samples\Multimedia\DAnim\C++\Showcase\Movie directory.

See Also

IDAView::get_IDirectDrawSurface

IDAView::put_Site


IDAView

Specifies the pointer to the IDAViewSite interface of the view site for this view. When you create a view, you should also create a view site. DirectAnimation sends status information about the view to the view site.

Syntax

HRESULT put_Site(
    IDAViewSite *pViewSite
);

Parameters

pViewSite
[in] Pointer to the IDAViewSite interface of the view site for this view.

Return Value

Returns an HRESULT value that indicates the success of the method or the reason why it failed. This HRESULT depends on the implementation of the interface.

See Also

IDAView::get_Site

IDAView::put_Window


IDAView

Sets the handle of the window in which to display the view.

Syntax

HRESULT put_Window(
    LONG hwnd
);

Parameters

hwnd
[in] Handle of the window in which to display the view.

Return Value

Returns an HRESULT value that indicates the success of the method or the reason why it failed. This HRESULT depends on the implementation of the interface.

See Also

IDAView::get_Window

IDAView::QueryHitPoint


IDAView

Goes through the image or geometry objects in a view and retrieves the number hit.

Syntax

HRESULT QueryHitPoint(
    DWORD dwAspect,
    LPCRECT prcBounds,
    POINT ptLoc,
    LONG lCloseHint,
    DWORD*pHitResult
);

Parameters

dwAspect
[in] Flag that specifies how the object will be represented. This parameter contains only one value taken from the enumeration DVASPECT or DVASPECT2. See Remarks.
prcBounds
[in] Pointer to a RECT structure specifying the bounding rectangle of the view to be checked.
ptLoc
[in] Point in device x- and y-coordinates to test for a hit.
lCloseHint
[in] Distance that defines "close" to the point checked for a hit.
pHitResult
[out] Pointer to the result of the hit query. Can be one of the following values.
HITRESULT_OUTSIDE
ptLoc is outside the bounds of prcBounds and not close to an object in the view.
HITRESULT_TRANSPARENT
ptLoc is within the bounds of prcBounds, but not close to an object in the view. For example, a point in the middle of a doughnut could be HITRESULT_TRANSPARENT.
HITRESULT_CLOSE
ptLoc is inside or outside the bounds of prcBounds, but close enough to an image or geometry object in the view to be considered "close" as defined by lCloseHint. Even if a point is outside the bounding rectangle of the view, it can still be close (this is needed for hitting small objects).
HITRESULT_HIT
ptLoc is within the bounds of prcBounds and within an image or geometry in the view.

Return Value

Returns an HRESULT value that indicates the success of the method or the reason why it failed. This HRESULT depends on the implementation of the interface.

Remarks

The DVASPECT enumeration values specify the desired data or view aspect of the object when drawing or getting data.

typedef enum tagDVASPECT 
{ 
    DVASPECT_CONTENT    = 1, 
    DVASPECT_THUMBNAIL  = 2, 
    DVASPECT_ICON       = 4, 
    DVASPECT_DOCPRINT   = 8 
} DVASPECT; 

The DVASPECT2 enumeration value is used to specify new drawing aspects used to optimize the drawing process.

typedef enum tagDVASPECT2 
{ 
    DVASPECT_OPAQUE         = 16, 
    DVASPECT_TRANSPARENT    = 32 
} DVASPECT2;

IDAView::RemoveRunningBvr


IDAView

Removes a behavior previously added with IDAView::AddBvrToRun from the view.

Syntax

HRESULT RemoveRunningBvr(
    LONG Id
);

Parameters

Id
[in] Identifier of the behavior to remove. This identifier is returned when the behavior is added with IDAView::AddBvrToRun.

Return Value

Returns an HRESULT value that indicates the success of the method or the reason why it failed. This HRESULT depends on the implementation of the interface.

See Also

IDAView::AddBvrToRun

IDAView::Render


IDAView

Renders the view. You can use this method to force a refresh whether the view has changed or not.

Syntax

HRESULT Render( );

Return Value

Returns an HRESULT value that indicates the success of the method or the reason why it failed. This HRESULT depends on the implementation of the interface.

Remarks

For examples of this method, see the following files:

IDAView::RePaint


IDAView

Repaints the specified rectangle of this view.

Syntax

HRESULT RePaint(
    LONG xPos,
    LONG yPos,
    LONG w,
    LONG h
);

Parameters

xPos, yPos
[in] Coordinates of the top-left corner of the rectangle to repaint.
w, h
[in] Width and height, in pixels, of the rectangle to repaint.

Return Value

Returns an HRESULT value that indicates the success of the method or the reason why it failed. This HRESULT depends on the implementation of the interface.

IDAView::SetClipRect


IDAView

Sets the clipping rectangle for this view. Graphics operations performed on this view will have no effect outside the clipping area.

Syntax

HRESULT SetClipRect(
    LONG xPos,
    LONG yPos,
    LONG w,
    LONG h
);

Parameters

xPos, yPos
[in] Coordinates of the top-left corner of the clipping rectangle.
w, h
[in] Width and height, in pixels, of the clipping rectangle.

Return Value

Returns an HRESULT value that indicates the success of the method or the reason why it failed. This HRESULT depends on the implementation of the interface.

IDAView::SetViewport


IDAView

Sets the viewport for the view. The viewport is a rectangle in device space. Viewport extents are measured in pixels for a video display.

Syntax

HRESULT SetViewport(
    LONG xPos,
    LONG yPos,
    LONG w,
    LONG h
);

Parameters

xPos, yPos
[in] Coordinates of the top-left corner of the viewport.
w, h
[in] Width and height, in pixels, of the viewport.

Return Value

Returns an HRESULT value that indicates the success of the method or the reason why it failed. This HRESULT depends on the implementation of the interface.

Remarks

A viewport is a rectangle in device space, such as on a video display.

For examples of this method, see the following files:

IDAView::StartModel


IDAView

Starts rendering the animation model with the specified image and sound at the specified base start time. If all synchronous imports are not loaded, rendering will be blocked until they are loaded.

Syntax

HRESULT StartModel(
    IDAImage *pImage,
    IDASound *pSound,
    double startTime
);

Parameters

pImage
[in] Pointer to the image to be rendered.
pSound
[in] Pointer to the sound to be rendered.
startTime
[in] Base time at which to start the clock for this model. Ticks will be relative to this time. Elapsed time is tick time minus startTime.

Return Value

Returns an HRESULT value that indicates the success of the method or the reason why it failed. This HRESULT depends on the implementation of the interface.

Remarks

You can use the startTime to synchronize with other models. For example, if another model starts at time 0 and something occurs in that model at time 1000 that you want to synchronize with, set startTime to 1000.

If you do not want rendering to be blocked by synchronous imports that are not loaded, you should use IDA2View::StartModelEx. If you set its flag to DAAsyncFlag and all synchronous imports are not loaded, StartModelEx returns E_PENDING but starts rendering the model.

For examples of this method, see the following files:

See Also

IDAView::StopModel

IDAView::StopModel


IDAView

Stops rendering of the current animation model.

Syntax

HRESULT StopModel( );

Return Value

Returns an HRESULT value that indicates the success of the method or the reason why it failed. This HRESULT depends on the implementation of the interface.

Remarks

For an example of this method, see the dxa.cpp file in the Samples\Multimedia\DAnim\C++\Showcase\Movie directory.

See Also

IDAView::StartModel

IDAView::Tick


IDAView

Tells the animation what time it is so that the view can be updated accordingly. Typically, you call StartModelEx once per view, and then call Tick with every new frame, to change the scene according to the simulation time (in seconds) specified. The actual elapsed time in the animation is the start time, set with StartModel, minus the simulation time.

Syntax

HRESULT Tick(
    double simTime,
    VARIANT_BOOL *needToRender
);

Parameters

simTime
[in] Simulation time to set.
needToRender
[out] Pointer to a value that indicates whether the scene at the new simulation time has been updated, and the view needs to be rendered again. If TRUE, the view needs to be rendered. If FALSE, the view does not need to be rendered.

Return Value

Returns an HRESULT value that indicates the success of the method or the reason why it failed. This HRESULT depends on the implementation of the interface.

Remarks

For examples of this method, see the following files:

See Also

IDAView::get_SimulationTime


Top of Page Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.