Share via


ICcTransport::CreateStream (Windows CE 5.0)

Send Feedback

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

HRESULT CreateStream(  LPCOLESTRwszStreamId,DWORDdwTimeout,VARIANT_BOOLbAsync,ICcTransportStream**piStream);

Parameters

  • wszStreamId
    [in] The stream ID in the form of a string that identifies the stream.

    If equal to L"", an ID is generated that can be retrieved from ICcTransportStream::ID.

    If not equal to L"", wszStreamId follows the transport-specific convention. For example, KITL is a string 16 characters long or less, and TCP is an IP address and port.

  • dwTimeout
    [in] Timeout in milliseconds for stream creation to complete.

    If the bAsync value is set to VARIANT_FALSE, and if 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 asynchronous stream creation call.

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

    If this is set to VARIANT_FALSE, the method blocks for dwTimeout 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 to receive the byte stream from the device.

Return Values

The following table shows return values for this method.

Value Description
S_OK Indicates success.
E_INVALIDARG Indicates invalid input arguments.
E_PENDING Indicates 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 device establishing the connection streams must match.

Requirements

OS Version: Windows CE 5.0 and later.
Header: CcTransport.idl.
Link Library: none.

See Also

Core Connectivity Interfaces

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.