DIWbemServices.GetObject

[This is preliminary documentation and subject to change.]

The DIWbemServices.GetObject method locates an object by path.

This method retrieves an object, either a class definition or an instance, based on the object's path. This method only retrieves objects from the namespace associated with the current DIWbemServices object.

DIWbemServices.GetObject(
  [in] ObjectPath As String,                          
  [in] lFlags As Long,                              
  [in] pCtx As Object,                        
  [out, OPTIONAL] ppObject As Object,    
  [out, OPTIONAL] ppCallResult As Object  
) As Long
 

Parameters

ObjectPath
The object path of the object to retrieve. If this is set to NOTHING, an empty object is returned That object can become a new class. See Class Creation.
lFlags
Reserved. It must be zero.
pCtx
Typically NOTHING. Otherwise, this is a DWbemContext 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.
ppObject
If not NOTHING, this parameter receives the object, if it is found. If there is an error, this parameter is set to NOTHING.
ppCallResult
If NOTHING, this is not used. Otherwise, the call returns immediately and ppCallResult receives a new DIWbemCallResult object. Periodically, this object can be polled to determine the result of the call. The caller can call DIWbemCallResult.GetResultObject to retrieve the object when the object becomes available.

Return Values

WBEM_E_ACCESS_DENIED The current user does not have permission to access the object.
WBEM_E_FAILED Unspecified error.
WBEM_E_INVALID_PARAMETER An invalid parameter was specified, or the namespace could not be parsed.
WBEM_E_INVALID_PATH The specified path was invalid.
WBEM_E_NOT_FOUND The requested object could not be found.
WBEM_E_OUT_OF_MEMORY There was not enough memory to complete the operation.
WBEM_E_RPC_FAILURE The RPC link between the client and CIMOM has failed.
WBEM_NO_ERROR Success.

For more information on return values see Visual Basic error handeling and return values.

See Also

Class Creation, Error Objects, DIWbemCallResult, DIWbemServices.GetObjectAsync, Object Paths