DIWbemServices.ExecNotificationQuery

[This is preliminary documentation and subject to change.]

The DIWbemServices.ExecNotificationQuery method executes a query to receive events. The call returns immediately. The user can poll the returned enumerator for events as they arrive. Releasing the returned enumerator cancels the query.

DIWbemServices.ExecNotificationQuery(
  [in] QueryLanguage As String,             
  [in] Query As String,                     
  [in] lFlags As Long,                    
  [in] pCtx As Object,              
  [out] ppEnum As Object       
) As Long
 

Parameters

QueryLanguage
A string containing one of the query languages supported by CIMOM. This cannot be vbNullString. Currently, only the WBEM Query Language (WQL) is supported.
Query
A string containing the text of the event-related query. This cannot be vbNullString.
lFlags
Reserved. It must be zero.
pCtx
Typically NOTHING. Otherwise, this is a DWbemContext object required by the dynamic class provider that is producing the class instances. The values in the context object must be specified in the documentation for the provider in question.
ppEnum
If no error occurs, this parameter receives the enumerator that allows the caller to retrieve the instances in the result set of the query. The caller periodically calls DIEnumWbemClassObject.Next to see if any events are available. Notice that in this usage, Reset does not move the enumerator back to the beginning of the event sequence; thus, it has no effect.

Return Values

WBEM_E_ACCESS_DENIED The current user is not authorized to view the result set.
WBEM_E_FAILED Unspecified error.
WBEM_E_INVALID_PARAMETER An invalid parameter was specified, or the namespace could not be parsed.
WBEM_E_INVALID_QUERY The query was not valid syntactically.
WBEM_E_INVALID_QUERY_LANGUAGE The requested query language is not supported.
WBEM_E_OUT_OF_MEMORY There was not enough memory to complete the operation.
WBEM_NO_ERROR Success.

For more information on return values see Visual Basic error handeling and return values.

See Also

Error Objects, DIWbemServices.ExecNotificationQueryAsync, Queries