IPortableDeviceServiceMethods::InvokeAsync method

The InvokeAsync method asynchronously invokes a method.

Syntax


HRESULT STDMETHODCALLTYPE InvokeAsync(
  [in]          REFGUID Method,
  [in, unique]  IPortableDeviceValues *pParameters,
  [in, unique]  IPortableDeviceServiceMethodCallback *pCallback
);

Parameters

Method [in]

The method to invoke.

pParameters [in]

A pointer to an IPortableDeviceValues interface that contains the parameters of the invoked method, or NULL to indicate that the method has no parameters.

pCallback [in]

A pointer to an application-supplied IPortableDeviceServiceMethodCallback callback object that receives the method results, or NULL to ignore the method results.

Return value

If the method succeeds, it returns S_OK. Any other HRESULT value indicates that the call failed.

Remarks

When invoking multiple methods, clients can create a separate instance of the IPortableDeviceServiceMethodCallback interface for each invocation, saving a context with that instance object before passing it to the InvokeAsync method. This way, the method operation can be identified when the OnComplete method is called. Use of a unique object for each invocation also allows targeted cancellation of an operation by the Cancel method.

Examples

For an example of how to use this method, see Invoking Service Methods Asynchronously.

Requirements

Minimum supported client

Windows 7 [desktop apps | Windows Store apps]

Minimum supported server

None supported [desktop apps | Windows Store apps]

Header

PortableDeviceAPI.h

IDL

PortableDeviceAPI.idl

See also

Invoking Service Methods Asynchronously
IPortableDeviceServiceMethods Interface

 

 

Community Additions

ADD
Show:
© 2014 Microsoft