IWbemServices::GetObjectAsync

[This is preliminary documentation and subject to change.]

The IWbemServices::GetObjectAsync method retrieves an object, either a class definition or instance, based on its path. This is similar to IWbemServices::GetObject except that the call returns immediately and the object is provided to the supplied object sink.

Currently, this method retrieves objects only from the namespace associated with the IWbemServices pointer.

HRESULT IWbemServices::GetObjectAsync(
  [in] BSTR bstrObjectPath,                   
  [in] LONG lFlags,                       
  [in] IWbemContext *pCtx,              
  [in] CALLBACK *pResponseHandler  
);
 

Parameters

bstrObjectPath
The object path of the object to retrieve. If this is NULL, an empty object, which can become a new class, is returned. See Class Creation.
lFlags
Reserved. It must be zero.
pCtx
Typically NULL. Otherwise, this is a pointer to an IWbemContext object required by the dynamic class provider that is producing the class instances. The values in the context object must be specified in the documentation for the provider in question.
pResponseHandler
Points to the caller's implementation of IWbemObjectSink. This handler receives the requested object when it becomes available through the IWbemObjectSink::SetStatus method. The pObjParam parameter contains the object. For a detailed explanation of this parameter, see also Asynchronous Methods. CIMOM only calls AddRef to the pointer in cases where WBEM_NO_ERROR is returned. In cases where an error code is returned, the reference count is the same as on entry.

Return Values

WBEM_E_FAILED Other error codes are returned asynchronously to the IWbemObjectSink.
WBEM_E_INVALID_PARAMETER An invalid parameter was specified, or the namespace could not be parsed.
WBEM_E_INVALID_PATH The specified object path was invalid.
WBEM_NO_ERROR The call succeeded.

On failure, you can obtain any available information from the COM function GetErrorInfo.

See Also

Asynchronous Methods, Class Creation, IWbemServices::GetObject, Object Paths