IWMSAnnouncementStreamFormats.Remove (Visual Basic .NET)

The Remove method removes an item, by index, from the IWMSAnnouncementStreamFormats collection.

Note

This method is available only on Windows Server 2003, Enterprise Edition; Windows Server 2003, Datacenter Edition; Windows Server 2008 Enterprise; and Windows Server 2008 Datacenter.

IWMSAnnouncementStreamFormats.Remove(
  varIndex As Variant
)

Arguments

varIndex

[in] Variant containing the index of the item to remove.

Return Value

If this method succeeds, it does not return a value. If it fails, it returns an error number.

Number

Description

0x8002000B

varIndex is an invalid index location.

Example

Imports Microsoft.WindowsMediaServices.Interop
Imports System.Runtime.InteropServices

Private Sub RemoveFile()

    ' Declare variables.
    Dim Server As WMSServer
    Dim PubPoints As IWMSPublishingPoints
    Dim PubPoint As IWMSPublishingPoint
    Dim BCPubPoint As IWMSBroadcastPublishingPoint
    Dim AnnounceStreamFormats As IWMSAnnouncementStreamFormats
    Dim varIndex As Integer
    Dim i As Integer

Try
    ' Create the WMSServer object.
    Server = New WMSServer()

    ' Retrieve the IWMSPublishingPoints object.
    PubPoints = Server.PublishingPoints

    ' Retrieve each publishing point and retrieve the
    ' IWMSBroadcastPublishingPoint object.
    For i = 0 To Server.PublishingPoints.Count - 1
        PubPoint = PubPoints.Item(i)
        If PubPoint.Type = WMS_PUBLISHING_POINT_TYPE.WMS_PUBLISHING_POINT_TYPE_BROADCAST Then
            BCPubPoint = PubPoint
            Exit For
        End If

    Next i

    ' Retrieve the pointer to the IWMSAnnouncementStreamFormats object.
    AnnounceStreamFormats = BCPubPoint.AnnouncementStreamFormats

    ' Remove the first file from the
    ' IWMSAnnouncementStreamFormats object.
    varIndex = 0
    AnnounceStreamFormats.Remove(varIndex)

Catch excCom As COMException
    ' TODO: Handle COM exceptions.
Catch exc As Exception
    ' TODO: Handle errors.
Finally
    ' TODO: Clean-up code goes here.
End Try

End Sub

Requirements

Reference: Add a reference to Microsoft.WindowsMediaServices.

Namespace: Microsoft.WindowsMediaServices.Interop.

Assembly: Microsoft.WindowsMediaServices.dll.

Library: WMSServerTypeLib.dll.

Platform: Windows Server 2003 family, Windows Server 2008 family.

See Also

Reference

IWMSAnnouncementStreamFormats Object (Visual Basic .NET)

IWMSAnnouncementStreamFormats.Add (Visual Basic .NET)

IWMSAnnouncementStreamFormats.RemoveAll (Visual Basic .NET)