ISWbemSinkEvents::OnObjectReady event

The OnObjectReady event of an SWbemSink object is triggered when an asynchronous operation returns an object. Use this event to process objects from asynchronous calls such as SWbemObject.InstancesAsync_ or SWbemServices.ExecQueryAsync. OnObjectReady returns one SWbemObject each time until the enumeration is complete.

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

Syntax

SWbemSink.OnObjectReady( _
  ByVal objWbemObject, _
  ByVal objWbemAsyncContext _
)

Parameters

objWbemObject

An SWbemObject object. This is similar to what is returned by the synchronous equivalent of the asynchronous call that triggers this event. For example, a call to the SWbemServices.GetAsync method returns an SWbemObject in the objWbemObject parameter of the OnObjectReady event of the SWbemSink object, which is passed as the objWbemObject parameter of the original call. The same SWbemObject object can be obtained by using an equivalent synchronous call to SWbemServices.Get.

objWbemAsyncContext

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 the completion of the OnObjectReady event, the Err object may contain one of the error codes below.

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 either semi-synchronous communication or synchronous communication. For more information, see Calling a Method.

Requirements

Requirement Value
Minimum supported client
Windows Vista
Minimum supported server
Windows Server 2008
Header
Wbemdisp.h
IDL
Wbemdisp.idl
DLL
Wbemdisp.dll
CLSID
CLSID_SWbemSink
IID
IID_ISWbemSinkEvents

See also

SWbemSink