SWbemSink.OnCompleted event

The OnCompleted event of an SWbemSink object is triggered when an asynchronous call is complete. This event indicates to the client application, the result of an asynchronous operation, and provides error information when the asynchronous call fails.

For an explanation of this syntax, see Document Conventions for the Scripting API.

Syntax


SWbemSink.OnCompleted( _
  ByVal iHResult, _
  ByVal objWbemErrorObject, _
  ByVal objWbemAsyncContext _
)

Parameters

iHResult

The HRESULT of the completed asynchronous method. The HRESULT is the same as the value that is returned from an equivalent COM API for WMI method call. Check this value to determine whether or not the asynchronous call is successful. If the asynchronous call is successful, this parameter contains WBEM_S_NO_ERROR (0). If the asynchronous call fails, this parameter contains an error code.

objWbemErrorObject

Contains an SWbemLastError object when the asynchronous method fails.

objWbemAsyncContext

This is an SWbemNamedValueSet object that is passed to the original asynchronous call. Use this parameter to identify the origin of the asynchronous call that triggers this event when multiple asynchronous calls are made using this object sink.

Return value

This event does not return a value.

Error codes

After completion of the OnCompleted event, the Err object may contain one of the error codes in the following table.

Error (Name/Dec/Hex)Meaning
wbemErrFailed
2147749889 (0x80041001)

Unspecified error.

wbemErrOutOfMemory
2147749894 (0x80041006)

Not enough memory to complete the operation.

wbemErrTransportFailure
2147749909 (0x80041015)

Networking error occurred, preventing normal operation.

Remarks

An asynchronous callback allows a non-authenticated user to provide data to the sink. This poses security risks to your scripts and applications. To eliminate the risks, use semisynchronous or synchronous communication. For more information, see Calling a Method.

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2003

Header

Wbemdisp.h

IDL

Wbemdisp.idl

DLL

Wbemdisp.dll

 

 

Show:
© 2015 Microsoft