Compartilhar via


IObexDevice::Connect

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/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
Windows Mobile Pocket PC 2002 and later, Smartphone 2002 and later

See Also

Reference

IObexDevice::SetPassword
IObexDevice:IUnknown
OBEX Interfaces

Concepts

Client Support