IServiceCall::OnCall method (comsvcs.h)

Triggers the execution of the batch work implemented in this method.

Syntax

HRESULT OnCall();

Return value

This method can return the standard return values E_INVALIDARG, E_OUTOFMEMORY, E_FAIL, and S_OK.

Remarks

The batch work that is run in this method runs in the context and thread apartment of the activity that was created by the call to CoCreateActivity. The batch work in this method is run through a call to either SynchronousCall or AsynchronousCall, using the IServiceActivity pointer that was returned from the call to CoCreateActivity.

You must make sure that this method is thread safe in situations where the activity object that is created by CoCreateActivity is not created with a synchronized context because in such situations many calls to OnCall can run at the same time.

To achieve the best performance from the system, the context configuration of the activity created by CoCreateActivity should be matched to the batch work performed by the OnCall method. For example, if the batch work in the OnCall method uses poolable objects, the activity created by CoCreateActivity should be configured to use the multithreaded apartment (MTA).

Requirements

Requirement Value
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header comsvcs.h

See also

IServiceCall