IWMEncDataViewCollection.Item
The Item method retrieves a specific IWMEncDataView object from the collection.
Syntax
Long = IWMEncDataViewCollection.Item(Index, DataView)
Parameters
Index
[in] Long containing the index of the object in the collection.
DataView
[out] The preview or postview object.
Return Values
This method returns a Long containing the ID of the stream associated with the preview or postview object. If this method fails, it returns an error number.
Number | Description |
0xC00D0011 | Either the index is less than 0 or greater than the number of objects in the data view collection. |
Remarks
To display previews and postviews, you must add the Windows Media Encoder Preview Control reference to the project. For more information, see Programming in Visual Basic.
Example Code
' Create a WMEncoder object.
Dim Encoder As WMEncoder
Set Encoder = New WMEncoder
' Configure the encoding session including the input sources,
' the profile, and the output.
' Retrieve an IWMEncDataViewCollection object from the
' video source object to display a postview.
Dim DVColl_Postview As IWMEncDataViewCollection
Set DVColl_Postview = SrcVid.PostviewCollection
' Create a WMEncDataView object.
Dim PostView As WMEncDataView
Set PostView = New WMEncDataView
' Add the WMEncDataView object to the collection. The ID of the stream
' is returned.
Dim lPostviewStream As Long
lPostviewStream = DVColl_Postview.Add(PostView)
' Retrieve the ID of the stream to postview.
lPostviewStream = DVColl_Postview.Item(0, PostView)
Requirements
Reference: Windows Media Encoder Preview Control
Library: wmprevu.dll
See Also