Export (0) Print
Expand All

IWbemContext::GetValue method

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

Syntax


HRESULT GetValue(
  [in]   LPCWSTR strName,
  [in]   LONG lFlags,
  [out]  VARIANT *pValue
);

Parameters

strName [in]

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

lFlags [in]

Reserved. This parameter must be 0.

pValue [out]

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 HRESULTHRESULT indicating the status of the method call. The following table lists the value contained within an HRESULTHRESULT.

Return codeDescription
WBEM_E_NOT_FOUND

The requested value was not found.

WBEM_E_INVALID_PARAMETER

A specified parameter is not valid.

WBEM_E_OUT_OF_MEMORY

There was not enough memory to complete the operation.

WBEM_S_NO_ERROR

The call succeeded.

 

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2003

Header

Wbemcli.h (include Wbemidl.h)

Library

Wbemuuid.lib

DLL

Esscli.dll;
Fastprox.dll;
Framedyn.dll;
Wbemcomn.dll;
Wbemcore.dll;
Wbemess.dll;
Wmipjobj.dll

See also

IWbemContext
IWbemContext::SetValue

 

 

Show:
© 2014 Microsoft