次の方法で共有


ICcServer::GetConnection (Compact 2013)

3/26/2014

Deprecated.

This method returns a pointer to the ICcConnection object for a specified target device.

In Windows Embedded Compact 2013, CoreCon HLAPI has been deprecated.

Syntax

HRESULT GetConnection(
  ICcDevice* piDevice,
  DWORD dwTimeout,
  ICcServiceCB* piCallback,
  BSTR* pbstrConnectionId,
  ICcConnection** piTargetDevice
);

Parameters

  • piDevice
    [in] A pointer to a valid ICcDevice that identifies the device to connect. This is normally retrieved from the datastore.
  • dwTimeout
    [in] Timeout in milliseconds for connect to complete if piCallback value is set to NULL.

    If the connection is not created within the specified timeout, the method returns failure.

    If piCallback value is set to non-NULL, this parameter is ignored.

  • piCallback
    [in] Pointer to the callback interface passed in by the clients.

    If this is a valid pointer, the method returns immediately and the caller is informed when the connection is created via callback interfaces ICcServiceCB.

    If this is NULL, the method blocks for dwTimeout milliseconds waiting for connection to be created.

  • pbstrConnectionId
    [out] Pointer to a connection ID that can be used to identify this connection.
  • piTargetDevice
    [out, retval] Out parameter pointing to the ICcConnection object.

    This is NULL if there is a failure, or if the call is an asynchronous call.

Return Value

If the method fails, it returns an HRESULT error code. Otherwise, the method returns one of the following values.

Value

Description

S_OK

Indicates success.

E_INVALIDARG

Indicates invalid input arguments.

E_PENDING

Indicates the connection could not be created within the given timeout.

E_FAIL

Indicates any other failure.

Remarks

To establish a connection, the user must call ICcConnection::ConnectDevice.

Requirements

Header

ccserver.h

See Also

Reference

ICcServer
Core Connectivity Interfaces