Share via


IRemoteToolStream::SendCommand2 (Compact 7)

3/12/2014

Sends a command to the device with a tracking ID.

Use IRemoteToolCommandSink to asynchronously obtain the response from the device.

Syntax

HRESULT SendCommand2([in] IRemoteToolCommand *pCommand, [in] DWORD dwTrackingID, [in] DWORD dwPluginID)

Parameters

  • pCommand
    The command to send to the device.
  • dwTrackingID
    An ID that the application supplies.

    The device-side library, Rtfhlp10.dll, uses this ID to synchronize the response from the device.

    It is recommended that these IDs be incremental, unique numbers to assist in distinguishing command instances. For example, this can be useful when repeatedly calling a command from different views in the plug-in.

    This ID is sent to IRemoteToolCommandSink2::OnCommand2 so that you can determine which command instance the target device-side process received.

  • dwPluginID
    The plug-in ID of the plug-in that is calling SendCommand2.

    The device-side library, Rtfhlp10.dll, uses this ID to specify the device-side process that pCommand is sent to.

    This ID is sent to IRemoteToolCommandSink2::OnCommand2 so that you can determine which device-side process responded with a command.

Return Value

E_INVALIDARG if pCommand is NULL.

ERROR_INVALID_DATA if the stream has not been instantiated.

RT_ERROR_DISCONNECTED (0x80040001) if the stream is currently disconnected from the device.

E_OUTOFMEMORY if the desktop is running low on memory.

RT_ERROR_ALLOCATEDSIZETOOSMALL (0x80040005) if too much data was added to pCommand and cannot be sent to the device.

S_OK if success.

See Also

Reference

IRemoteToolStream
IRemoteToolCommandSink2::OnCommand2