Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

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

Header

PortableDeviceAPI.h

IDL

PortableDeviceAPI.idl

See also

Invoking Service Methods Asynchronously
IPortableDeviceServiceMethods Interface

 

 

Community Additions

Show:
© 2017 Microsoft