Share via


IWMSDiagnosticEvents.Item (Visual Basic .NET)

banner art

Previous Next

IWMSDiagnosticEvents.Item (Visual Basic .NET)

The property retrieves an IWMSDiagnosticEvent object from the IWMSDiagnosticEvents collection.

Syntax

  IWMSDiagnosticEvent
   = IWMSDiagnosticEvents.Item(
  varIndex As Variant
)

Parameters

varIndex

[in] Variant containing the index of the IWMSDiagnosticEvent object.

Property Value

This property returns an IWMSDiagnosticEvent object.

Remarks

This property is read-only.

Example Code

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

Private Sub GetDiagnosticEvent()

    ' Declare variables.
    Dim Server As WMSServer
    Dim DiagnosticEvents As IWMSDiagnosticEvents
    Dim DiagnosticEvent As IWMSDiagnosticEvent
    Dim iCount As Integer

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

    ' Retrieve the IWMSDiagnosticEvents object.
    DiagnosticEvents = Server.DiagnosticEvents

    ' Retrieve information about each diagnostic event.
    For i = 0 To DiagnosticEvents.Count - 1
        DiagnosticEvent = DiagnosticEvents.Item(i)
        ' Retrieve the number of times this event occurred.
        lCount = DiagnosticEvent.NumberOfOccurrences
    Next i

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