WbemFlagEnum Enumeration

The WbemFlagEnum enumeration defines constants that are used by SWbemServices.ExecQuery, SWbemServices.ExecQueryAsync, SWbemServices.SubclassesOf, and SWbemServices.InstancesOf.

The WMI scripting type library, wbemdisp.tlb, defines these constants. Visual Basic applications can access this library; script languages must use the value of the constant directly, unless they use the Windows Script Host (WSH) XML file format. For more information, see Using the WMI Scripting Type Library.

Syntax

typedef enum WbemFlagEnum {
  wbemFlagReturnImmediately,
  wbemFlagReturnWhenComplete,
  wbemFlagBidirectional,
  wbemFlagForwardOnly,
  wbemFlagNoErrorObject,
  wbemFlagReturnErrorObject,
  wbemFlagSendStatus,
  wbemFlagDontSendStatus,
  wbemFlagEnsureLocatable,
  wbemFlagDirectRead,
  wbemFlagSendOnlySelected,
  wbemFlagUseAmendedQualifiers,
  wbemFlagGetDefault,
  wbemFlagSpawnInstance,
  wbemFlagUseCurrentTime
} ;

Constants

wbemFlagReturnImmediately Causes the call to return immediately.
wbemFlagReturnWhenComplete Causes this call to block until the call has completed.
wbemFlagBidirectional Causes WMI to retain pointers to objects of the enumeration until the client releases the enumerator.
wbemFlagForwardOnly Causes a forward-only enumerator to be returned. Use this flag in combination with wbemFlagReturnImmediately to request semisynchronous access. For more information, see Calling a Method.

You can only iterate (as in a VBScript For Each statement) through a forward-only enumerator one time. The memory containing the instances is released by WMI so that the enumerator cannot be rewound. Therefore, the SWbemObjectSet.Count method cannot be used since it requires rewinding the enumerator.

Forward-only enumerators are generally much faster and use less memory than conventional enumerators, but they do not allow calls to SWbemObject.Clone.

wbemFlagNoErrorObject This flag must not be set, and must be ignored on receipt.
wbemFlagReturnErrorObject Causes asynchronous calls to return an error object in the event of an error.
wbemFlagSendStatus Causes asynchronous calls to send status updates to the SWbemSink.OnProgress event handler for your object sink.
wbemFlagDontSendStatus Prevents asynchronous calls from sending status updates to the SWbemSink.OnProgress event handler for your object sink.
wbemFlagEnsureLocatable
wbemFlagDirectRead
wbemFlagSendOnlySelected
wbemFlagUseAmendedQualifiers Causes WMI to return class amendment data along with the base class definition. For more information about amended qualifiers, see Localizing WMI Class Information.
wbemFlagGetDefault
wbemFlagSpawnInstance
wbemFlagUseCurrentTime

Requirements

   
Minimum supported client Windows Vista
Minimum supported server Windows Server 2008
Header wbemdisp.h

See Also

Calling a Method

Making a Semisynchronous Call with VBScript

Scripting API Constants