SWbemSink.OnProgress event

The OnProgress event of SWbemSink is triggered when an asynchronous call returns the status of a call that is in progress. If the events, instances, or classes are produced from a provider that supports status updates, you can place code in this event to provide users with feedback about the status of an asynchronous operation. You must set the iFlags parameter of the asynchronous call to wbemFlagSendStatus (128/0x80) if you want to receive status updates, otherwise this event is not triggered.

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

Syntax

SWbemSink.OnProgress( _
  ByVal iUpperBound, _
  ByVal iCurrent, _
  ByVal strMessage, _
  ByVal objWbemAsyncContext _
)

Parameters

iUpperBound

Integer that describes the total number of tasks to complete.

iCurrent

Current item that is being processed.

strMessage

Message that describes the status of the current task.

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 OnProgress 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

The OnProgress event is triggered when an asynchronous call returns the status of a call that is in progress. If the events, instances, or classes are produced from a provider that supports status updates, you can place code in this event to give users feedback about the status of an asynchronous operation.

Note  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

See also

SWbemSink

 

 

Show:
© 2014 Microsoft