This topic has not yet been rated - Rate this topic

SWbemSink.OnObjectReady event

Applies to: desktop apps only

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

Requirements

Minimum supported client

Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Header

Wbemdisp.h

IDL

Wbemdisp.idl

DLL

Wbemdisp.dll

See also

SWbemSink

 

 

Send comments about this topic to Microsoft

Build date: 3/9/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Return values
Is it possible to capture the return value of the process behind the "objWbemObject" ?
I launch a process asynchronously and want to capture the exit code of that process. Is that possible via the event sink methods?

Thanks,
Thomas