[This is preliminary documentation and subject to change.]
The IWbemClassObject::Next method retrieves the next property in an enumeration that was started with IWbemClassObject::BeginEnumeration. This should be called repeatedly to enumerate all the properties until WBEM_S_NO_MORE_DATA is returned. If the enumeration is to be terminated early, then IWbemClassObject::EndEnumeration should be called.
The order of the properties returned during the enumeration is not defined.
HRESULT IWbemClassObject::Next(
[in] Long lFlags,
[out, OPTIONAL] BSTR *pbstrName,
[out, OPTIONAL] VARIANT *pVal,
[out, OPTIONAL] VARTYPE *pvtType,
[out, OPTIONAL] Long *plFlavor
);
You can set it to NULL if the value is not required. If an error code is returned, the VARIANT pointed to by pVal is left unmodified.
WBEM_E_INVALID_PARAMETER | An invalid parameter was specified, or the namespace could not be parsed. |
WBEM_E_OUT_OF_MEMORY | There was not enough memory to complete the operation. |
WBEM_E_UNEXPECTED | Did not call IWbemClassObject::BeginEnumeration. |
WBEM_NO_ERROR | Success. |
WBEM_S_NO_MORE_DATA | No more properties are left in the enumeration. |
If the underlying type of the property is an object path, a date/time, or another special type, then the returned type does not contain enough information. The caller must examine the CIMTYPE qualifier for the specified property, and determine if the property is an object reference, date/time, or another special type.
This method also returns system properties.
IWbemClassObject::BeginEnumeration, IWbemClassObject::EndEnumeration, IWbemClassObject::Get, System Properties