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.
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
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
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
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
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
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
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
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
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
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.
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_END DAKEY_HOME DAKEY_LEFT DAKEY_UP DAKEY_RIGHT DAKEY_DOWN DAKEY_INSERT DAKEY_DELETE DAKEY_NUMPAD0 DAKEY_NUMPAD1 DAKEY_NUMPAD2 DAKEY_NUMPAD3 DAKEY_NUMPAD4 DAKEY_NUMPAD5 DAKEY_NUMPAD6 DAKEY_NUMPAD7 DAKEY_NUMPAD8 DAKEY_NUMPAD9 DAKEY_MULTIPLY DAKEY_ATD DAKEY_SEPARATOR DAKEY_SUBTRACT DAKEY_DECIMAL DAKEY_DIVIDE DAKEY_F1 DAKEY_F2 DAKEY_F3 DAKEY_F4 DAKEY_F5 DAKEY_F6 DAKEY_F7 DAKEY_F8 DAKEY_F9 DAKEY_F10 DAKEY_F11 DAKEY_F12 DAKEY_F13 DAKEY_F14 DAKEY_F15 DAKEY_F16 DAKEY_F17 DAKEY_F18 DAKEY_F19 DAKEY_F20 DAKEY_F21 DAKEY_F22 DAKEY_F23 DAKEY_F24 DAKEY_PGUP DAKEY_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.
Flag Description Value DAEMOD_SHIFT_MASK the SHIFT key 0x01 DAEMOD_CTRL_MASK the CTRL key 0x02 DAEMOD_ALT_MASK the ALT key 0x04 DAEMOD_META_MASK the META key 0x08
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.
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.
Flag Description Value DAEMOD_SHIFT_MASK the SHIFT key 0x01 DAEMOD_CTRL_MASK the CTRL key 0x02 DAEMOD_ALT_MASK the ALT key 0x04 DAEMOD_META_MASK the META key 0x08
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.
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.
Flag Description Value DAEMOD_SHIFT_MASK the SHIFT key 0x01 DAEMOD_CTRL_MASK the CTRL key 0x02 DAEMOD_ALT_MASK the ALT key 0x04 DAEMOD_META_MASK the META key 0x08
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.
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.
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
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
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
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
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
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
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;
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
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:
- Samples\Multimedia\DAnim\C++\Showcase\Donut\donut.cpp.
- Samples\Multimedia\DAnim\C++\Showcase\Donut\dxa.cpp.
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.
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.
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:
- Samples\Multimedia\DAnim\C++\Showcase\Donut\dxa.cpp.
- Samples\Multimedia\DAnim\C++\Showcase\Union\dxa.cpp.
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:
- Samples\Multimedia\DAnim\C++\Showcase\Donut\dxa.cpp.
- Samples\Multimedia\DAnim\C++\Showcase\Movie\dxa.cpp.
- Samples\Multimedia\DAnim\C++\Showcase\Union\dxa.cpp.
See Also
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
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:
- Samples\Multimedia\DAnim\C++\Showcase\Movie\dxa.cpp.
- Samples\Multimedia\DAnim\C++\Showcase\Donut\donut.cpp.
- Samples\Multimedia\DAnim\C++\Showcase\Union\dxa.cpp.
See Also
Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.