IWbemContext::GetValue

[This is preliminary documentation and subject to change.]

The IWbemContext::GetValue method

HRESULT GetValue(
  [in] BSTR bstrName,
  [in] LONG lFlags,
  [out] VARIANT *pValue 
);
 

Parameters

bstrName
The name for which the value is to be retrieved. This must point to a valid BSTR. The pointer is treated as read-only.
lFlags
Reserved. It must be zero.
pValue
This parameter cannot be NULL and must point to an uninitialized VARIANT. If no error is returned, the VARIANT is initialized using VariantInit, and then set to contain the context value. The caller must call VariantClear on this pointer when the value is no longer required. If an error code is returned, the VARIANT pointed to by pValue is left unmodified.

It is possible that an entire IWbemClassObject can be returned inside the VARIANT. If that is the case, then VT_DISPATCH is the VARIANT type. The caller can take the IDispatch pointer and execute QueryInterface to obtain the IWbemClassObject pointer.

Return Values

WBEM_E_NOT_FOUND The requested value was not found.
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_NO_ERROR Success.

See Also

IWbemContext::SetValue