[This is preliminary documentation and subject to change.]
The DIWbemServices.ExecMethod method executes a method exported by a CIM object. This method will block while the method being forwarded to the appropriate provider executes and the information and status are then returned.
CIMOM does not implement the methods directly. The method providers export the methods. For any given CIM class, the available methods and their parameters must be specified in the documentation for the provider in question.
DIWbemServices.ExecMethod(
[in] ObjectPath As String,
[in] MethodName As String,
[in] lFlags As Long,
[in] pCtx As Object,
[in] pInParams As Object,
[out, OPTIONAL] ppOutParams As Object,
[out, OPTIONAL] ppCallResult As Object
) As Long
If not NOTHING, receives an object containing outbound parameters and return values for the method execution. The contents of this object are method-specific. They are part of the specification for the provider in question.
WBEM_E_FAILED | Unspecified error. |
WBEM_E_INVALID_CLASS | The specified class was invalid. |
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_INVALID_METHOD | The requested method was not available. |
WBEM_E_ACCESS_DENIED | The current user was not authorized to execute the method. |
WBEM_E_INVALID_METHOD_PARAMETERS | The provider determined the supplied pInParams object was invalid. |
WBEM_NO_ERROR | Success. |
For more information on return values see Visual Basic error handeling and return values
DIWbemServices.ExecMethodAsync, DIWbemCallResult.GetResultObject