IWbemContext::GetValue method (wbemcli.h)

The IWbemContext::GetValue method is used to retrieve a specific named context value by name.

Syntax

HRESULT GetValue(
  [in]  LPCWSTR wszName,
  [in]  long    lFlags,
  [out] VARIANT *pValue
);

Parameters

[in] wszName

Name for which the value is to be retrieved. This must point to a valid BSTR. The pointer is treated as read-only.

[in] lFlags

Reserved. This parameter must be 0.

[out] 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 object can be returned inside the VARIANT. If that is the case, then VT_UNKNOWN is the VARIANT type. The caller can take the IUnknown pointer and execute QueryInterface to obtain the IWbemClassObject pointer.

Return value

This method returns an HRESULT indicating the status of the method call. The following list lists the value contained within an HRESULT.

Requirements

Requirement Value
Minimum supported client Windows Vista
Minimum supported server Windows Server 2008
Target Platform Windows
Header wbemcli.h (include Wbemidl.h)
Library Wbemuuid.lib
DLL Esscli.dll; Fastprox.dll; FrameDyn.dll; FrameDynOS.dll; Wbemcomn.dll; Wbemcore.dll; Wbemess.dll; Wmipjobj.dll

See also

IWbemContext

IWbemContext::SetValue