Поделиться через


IWMSDiagnosticEvents Interface

The IWMSDiagnosticEvents interface contains a collection of IWMSDiagnosticEvent interfaces. The collection can contain a maximum of 100 IWMSDiagnosticEvent interfaces. When this limit is reached, the oldest interface in the collection is replaced by the newest. Each IWMSDiagnosticEvent interface that describes a unique server or publishing point limit is included only once in the collection, but the time and date are updated to reflect the most recent occurrence.

In addition to the methods inherited from IDispatch, the IWMSDiagnosticEvents interface exposes the following methods.

Method

Description

get_Count

Retrieves the number of IWMSDiagnosticEvent interfaces contained in the IWMSDiagnosticEvents collection.

get_Item

Retrieves an IWMSDiagnosticEvent interface from the IWMSDiagnosticEvents collection.

get_length

Retrieves the number of IWMSDiagnosticEvent interfaces contained in the IWMSDiagnosticEvents collection. This method is provided for JScript compatibility.

RemoveAll

Removes all IWMSDiagnosticEvent interfaces from the IWMSDiagnosticEvents collection.

Example

The following example illustrates how to retrieve a pointer to an IWMSDiagnosticEvents interface.

#include <windows.h>
#include "wmsserver.h"

// Declare variables and interfaces.
IWMSServer              *pServer;
IWMSDiagnosticEvents    *pDiagnosticEvents;

HRESULT         hr;

// Initialize the COM library and retrieve a pointer
// to an IWMSServer interface.
hr = CoInitialize(NULL);
hr = CoCreateInstance(CLSID_WMSServer,
                      NULL,
                      CLSCTX_ALL,
                      IID_IWMSServer,
                      (void **)&pServer);
if (FAILED(hr)) goto EXIT;

// Retrieve a pointer to the IWMSDiagnosticEvents
// interface.
hr = pServer->get_DiagnosticEvents(&pDiagnosticEvents);
if (FAILED(hr)) goto EXIT;

EXIT:
    // TODO: Release temporary COM objects and uninitialize COM.

See Also

Reference

IWMSDiagnosticEvent Interface

Concepts

Server Object Model Interfaces (C++)