[This is preliminary documentation and subject to change.]
The IWbemContext::GetValue method
HRESULT GetValue(
[in] BSTR bstrName,
[in] LONG lFlags,
[out] VARIANT *pValue
);
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.
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. |