SWbemEventSource.NextEvent method

If an event is available, the NextEvent method of the SWbemEventSource object retrieves the event from an event query.

For an explanation of this syntax, see Document Conventions for the Scripting API.

Syntax

objWbemObject = .NextEvent( _
  [ ByVal iTimeoutMs ] _
)

Parameters

iTimeoutMs [in, optional]

Number of milliseconds the call waits for an event before returning a time-out error. The default value for this parameter is wbemTimeoutInfinite (-1), which directs the call to wait indefinitely.

Return value

If the NextEvent method is successful, it returns an SWbemObject object that contains the requested event. If the call times out, the returned object is NULL and an error is raised.

Error codes

Upon the completion of the NextEvent method, the Err object may contain the error code in the following list.

wbemErrTimedOut - 0x80043001

Requested event did not arrive in the amount of time specified in iTimeoutMs.

Requirements

Requirement Value
Minimum supported client
Windows Vista
Minimum supported server
Windows Server 2008
Header
Wbemdisp.h
Type library
Wbemdisp.tlb
DLL
Wbemdisp.dll
CLSID
CLSID_SWbemEventSource
IID
IID_ISWbemEventSource