次の方法で共有


ICcTransport::CreateStream (Compact 2013)

3/26/2014

Deprecated.

This method creates a stream based on a stream ID for the given transport.

Syntax

HRESULT CreateStream(
  LPCOLESTR wszStreamId,
  DWORD dwTimeout,
  VARIANT_BOOL bAsync,
  ICcTransportStream** piStream
);

Parameters

  • wszStreamId
    [in] The stream ID in the form of a string of one through 16 characters.
  • dwTimeout
    [in] Timeout in milliseconds for stream creation to complete.

    If the bAsync value is set to VARIANT_FALSE and the stream is not created within the specified timeout, this method returns failure.

    If the bAsync value is set to VARIANT_TRUE, this parameter is ignored.

  • bAsync
    [in] Indicator for an asynchronous stream creation call.

    If this value is set to VARIANT_TRUE, the method returns immediately and the caller is informed when the stream is created via the callback interface ICcServiceCB.

    If this value is set to VARIANT_FALSE, the method blocks for dwTimeout while waiting for the stream to be created.

  • piStream
    [out, retval] Pointer to the ICcTransportStream object.

    The stream object can be used to send raw bytes and receive the byte stream from the device.

Return Value

The following table shows return values for this method.

Value

Description

S_OK

Indicates success.

E_INVALIDARG

Indicates invalid input arguments.

E_PENDING

Indicates that the stream could not be created within the given timeout.

Users can try again with the same or a different timeout value.

E_FAIL

Indicates any other failure.

E_OUTOFMEMORY

Indicates that the stream could not be created due to insufficient memory.

The application might be able to free memory and retry the operation.

Remarks

The stream IDs of the associated desktop and the device establishing the connection streams must match.

Requirements

Header

cctransport.idl

See Also

Reference

ICcTransport
Core Connectivity Interfaces