IWMEncSourceGroupCollection.Remove

Windows Media Encoder SDK banner art

The Remove method removes a source group from the collection.

Syntax

IWMEncSourceGroupCollection.Remove(var)

Parameters

var

[in]  Variant containing the name or index of the source group.

Return Values

If this method fails, it returns an error number.

Number Description
0xC00D1B60 The active source group cannot be deleted while the encoder engine is running.

Example Code

' Create a WMEncoder object.
Dim Encoder As WMEncoder
Set Encoder = New WMEncoder

' Declare objects and variables.
Dim SrcGrpColl As IWMEncSourceGroupCollection
Dim SrcGrp As IWMEncSourceGroup
Dim SrcGrp1 As IWMEncSourceGroup
Dim SrcGrp2 As IWMEncSourceGroup
Dim SrcGrp3 As IWMEncSourceGroup
Dim i As Integer

' Create an IWMEncSourceGroupCollection object.
Set SrcGrpColl = Encoder.SourceGroupCollection

' Add new source groups to the collection.
Set SrcGrp1 = SrcGrpColl.Add("SG_1")
Set SrcGrp2 = SrcGrpColl.Add("SG_2")
Set SrcGrp3 = SrcGrpColl.Add("SG_3")

' Loop through the collection to find a specific
' source group.
For i = 0 To SrcGrpColl.Count - 1
    Set SrcGrp = SrcGrpColl.Item(i)
    If SrcGrp.Name = "SG_3" Then
        ' Move SrcGrp3 in front of SrcGrp1.
        SrcGrpColl.Move SrcGrp3, SrcGrp1
        ' Make ScrGrp3 active.
        SrcGrpColl.Active = SrcGrp3
    End If
Next
   
' Remove SrcGrp2, by index, from the collection.
SrcGrpColl.Remove 2

Requirements

Reference: Windows Media Encoder

Library: wmenc.exe

See Also