Share via


IObexDevice::Connect (Windows CE 5.0)

Send Feedback

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

HRESULT Connect(LPCWSTRpszPassword,DWORDdwCapability,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 Values

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

Smartphone: Smartphone 2002 and later

Pocket PC: Pocket PC 2002 and later

OS Versions: Windows CE .NET 4.0 and later.

Header: Obex.h, Obex.idl.

Link Library: Uuid.lib.

See Also

Client Support | IObexDevice::SetPassword | IObexDevice | OBEX Interfaces

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.