Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This method returns a pointer to the IObexDeviceinterface.

Syntax

HRESULT BindToDevice(
  IPropertyBag* 
pPropertyBag, 
  IObexDevice** 
ppDevice
);

Parameters

pPropertyBag

[in] Property bag that describes the device.

ppDevice

[out] Pointer to the IObexDeviceinterface.

Return Value

This method returns one of the following values.

Return value Description

S_OK

The method completed successfully.

E_POINTER

An invalid pointer was passed in either the property bag or the device.

E_INVALIDARG

The argument was invalid.

E_FAIL

The request failed.

E_OUTOFMEMORY

Out of memory.

OBEX_E_NOT_INITIALIZED

Not initialized.

Remarks

This method provides a pointer to a device by using the property bag values of that device. When asynchronous device notification is being used, IObex::BindToDeviceprovides the data transfer connection to a specified device.

This method should be used if device enumeration is done outside of the OBEX interfaces. The calling application must acquire the address and specify which transport to use or the name of the device.

Note:
This method should always be used because it makes the physical (IRDA/BTH) connection.

Toobtain the GUID for the transport,such as for IRDA or Bluetooth, you can populate the transport in the property bag. For example, pPropertyBagwould be RequestServiceUUID.

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