Share via


IWMSBroadcastPublishingPoint.Announce (Visual Basic .NET)

banner art

Previous Next

IWMSBroadcastPublishingPoint.Announce (Visual Basic .NET)

The Announce method updates the publishing points multicast configuration with data formats that have been added to the IWMSAnnouncementStreamFormats object.

  • 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.

Syntax

  IWMSBroadcastPublishingPoint
  .Announce()

Parameters

This method takes no parameters.

Return Values

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

Number Description
0xC00D1459L This feature is not supported on this operating system.
0xC00D1458L A multicast plug-in is not enabled on the publishing point.
0xC00D006BL The IWMSAnnouncementStreamFormats collection does not contain any stream format information.
0xC00D145AL The publishing point has already been removed.
0xC00D1456L More than one multicast plug-in is enabled on the publishing point. Only one multicast plug-in can be enabled per publishing point.

Remarks

The Announce method retrieves stream format data from the IWMSAnnouncementStreamFormats Object, and property data from an enabled multicast plug-in. Only one multicast plug-in can be enabled at a time. If no multicast plug-ins are enabled, the Announce method returns an error. If the file names in the IWMSAnnouncementStreamFormats collection reference media files that all use the same format, only one instance of the stream format information is used. After you have called the Announce method, you can call the IWMSBroadcastPublishingPoint.AnnounceToNSCFile method to create the file needed by the client to receive and render the broadcast. Call the Announce and the AnnounceToNSCFile methods whenever information included in the file is changed.

The Announce method is required for multicasting content from a broadcast publishing point, but it is not required for a unicast broadcast.

Example Code

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

Private Sub PrepAnnouncement()

    ' Declare variables.
    Dim Server As WMSServer
    Dim PubPoints As IWMSPublishingPoints
    Dim PubPoint As IWMSPublishingPoint
    Dim BCPubPoint As IWMSBroadcastPublishingPoint
    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

    ' Prepare the publishing point configuration for
    ' announcement to clients.
    BCPubPoint.Announce()

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

Previous Next