Partager via


IObexDevice::Connect (Windows Embedded CE 6.0)

1/6/2010

This method initiates an OBEX transaction with a specific remote device.

Syntax

HRESULT Connect(
  LPCWSTR pszPassword,
  DWORD dwCapability,
  IHeaderCollection* pHeaders
);

Parameters

  • pszPassword
    [in] A password for the connection (optional). If a password is unnecessary, set this parameter to NULL.
  • dwCapability
    [in] Reserved. Set to 0.
  • pHeaders
    [in] Points to the header list that may provide the server with additional information. For example, if the list contains the Target header, then the client can use it retrieve the UUID of the server. If the Target header is not included in the list, then the connection is made to the default service, Inbox Server.

Return Value

This method returns one of the following values.

Return value Description

S_OK

The connection was established successfully.

E_FAIL

The connection failed.

OBEX_E_CONNECTION_NOT_ACCEPTED

The authentication failed. The password is most likely incorrect.

Remarks

If a password is not specified and the server requires a password, a callback is made to the interface registered on the main OBEX object. If no interface is registered for callbacks and a password is required, the method fails. If the password is not specified, the password specified in IObexDevice::SetPassword.

Note

This method does not make the connection but it sends a new CONNECT packet. The physical transport might already exist and be reused.

To connect to a custom service, refer to that service using its associated GUID.

Requirements

Header obex.h, obex.idl
Library uuid.lib
Windows Embedded CE Windows CE .NET 4.0 and later

See Also

Reference

IObexDevice:IUnknown
IObexDevice::SetPassword
OBEX Interfaces

Concepts

Client Support