IWbemContext::GetNames

[This is preliminary documentation and subject to change.]

The IWbemContext::GetNames method returns a SAFEARRAY of all of the names of the named context values. After all the names are known, GetValue can be called on each name to retrieve the value. This technique is a way of accessing the context values that is different from calling the BeginEnumeration, Next, and EndEnumeration methods.

HRESULT GetNames(
  [in] LONG lFlags,
  [out] SAFEARRAY (BSTR) *pbstrNames
);
 

Parameters

lFlags
Reserved. Itust be zero.
pbstrNames
This parameter cannot be NULL, but on entry it must point to NULL. If no error is returned, on exit pbstrNames receives a pointer to a new SAFEARRAY of type VT_BSTR containing all the context value names. The caller must call SafeArrayDestroy on the returned pointer when the array is no longer required. If an error code is returned, the pbstrNames pointer is set to point to NULL.

Note  If there are no named values in the object, the call succeeds and returns an array of length zero.

Return Values

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::GetValue, IWbemContext::BeginEnumeration