DIWbemServices.ExecMethodAsync

[This is preliminary documentation and subject to change.]

The DIWbemServices.ExecMethodAsync method asynchronously executes a method exported by a CIM object. The call immediately returns to the client. The in-parameters are forwarded to the appropriate provider where the exported method executes. Information and status return to the caller through the supplied object sink.

CIMOM does not implement the methods directly. The method providers export the methods. For any given CIM class, the available methods and their parameters are part of the documentation for the provider in question.

DIWbemServices.ExecMethodAsync(
  [in]  ObjectPath As String,                   
  [in]  MethodName As String,
  [in] lFlags As Long,                       
  [in] pCtx As Object,                 
  [in] pInParams As Object,
  [in] pResponseHandler As Object
) As Long
 

Parameters

ObjectPath
A string containing the object path of the object for which the method is to be executed.
MethodName
The name of the method for the object.
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.
pInParamsCan be NOTHING if no in-parameters are required to execute the method. Otherwise, this is a DWbemClassObject that contains the properties. The properties act as inbound parameters for the method execution. The contents of the object are method-specific, and are part of the specification for the provider in question.
pResponseHandler
Must not be NOTHING. The object sink receives the result of the method call. The out-parameters are sent to DIWbemObjectSink.Indicate. The result of the call mechanism itself will be sent to DIWbemObjectSink.SetStatus. Notice that DIWbemObjectSink.SetStatus does not receive the return code of the CIM method, but receives the return code of the actual call-return mechanism. It is useful only when you are verifying that the call occurred or that it failed for mechanical reasons. The out-parameter object supplied to DIWbemObjectSink.Indicate returns the result code from the CIM method.

Return Values

WBEM_E_FAILED Unspecified error.
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_E_ACCESS_DENIED The current user was not authorized to execute the method.
WBEM_NO_ERROR Success.

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

Other errors will be reported asynchronously to the object sink supplied in the pReponseHandler parameter

See Also

DIWbemServices.ExecMethod