IWMSOutgoingDistributionConnections.Remove (Visual Basic .NET)

banner art

Previous Next

IWMSOutgoingDistributionConnections.Remove (Visual Basic .NET)

The Remove method removes an IWMSOutgoingDistributionConnection object from the IWMSOutgoingDistributionConnections collection.

Syntax

  IWMSOutgoingDistributionConnections
  .Remove(
  varIndex As Variant
)

Parameters

varIndex

[in] Variant that contains the index of the IWMSOutgoingDistributionConnection object to be removed.

Return Values

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

Number Description
0x8002000B varIndex is an invalid index location.

Remarks

If you have created a previous instance of the collection, you must call IWMSOutgoingDistributionConnections.Refresh to update the object.

Example Code

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

Private Sub RemoveConnection()

    ' Declare variables.
    Dim Server As WMSServer
    Dim Connections As IWMSOutgoingDistributionConnections

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

    ' Retrieve the IWMSOutgoingDistributionConnections object.
    Connections = Server.OutgoingDistributionConnections

    ' Remove the first connection from the collection.
    Connections.Remove(0)

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