Share via


IWMSFileDescriptions.Delete (Visual Basic .NET)

banner art

Previous Next

IWMSFileDescriptions.Delete (Visual Basic .NET)

The Delete method removes an IWMSFileDescription object from the IWMSFileDescriptions collection.

Syntax

  IWMSFileDescriptions
  .Delete(
  varIndex As Variant
)

Parameters

varIndex

[in] Variant containing the IWMSFileDescription object to be removed.

Return Values

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 Code

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

Private Sub RemoveFileDescription()

    ' Declare variables.
    Dim Server As WMSServer
    Dim FileDescriptions As IWMSFileDescriptions
    Dim strPath As String

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

    ' Retrieve the IWMSFileDescriptions object.
    strPath = "file://c:\wmpub\wmroot"
    FileDescriptions = Server.FileDescriptions(strPath, WMS_FILE_TYPE.WMS_FILE_UNSPECIFIED)

    ' Delete the first file description from the collection.
    FileDescriptions.Delete(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