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

To copy a file to the OBEX server, send a data object to the server by using the IObexDevice::Putmethod. The request can contain the Name and Length headers, however, if the target device is so simple that it accepts only one object, the headers may be omitted. If the server is a desktop computer, personal digital assistant (PDA), or any other general-purpose device, headers are highly recommended.

Hardware and Software Assumptions

You have declared pointers to the following interfaces:

Steps

Step Topic

1. Enable the client to discover an OBEX device by using IConnectionPointContainerand IObexSink:IUnknowninterfaces.

Discovering OBEX Devices

2. Retrieve the IObexDevicereference.

None.

3. Call the appropriate method of the IHeaderCollectioninterface to add a header.

None.

4. Call the IObexDevice::Connectmethod on the IObexDevicereference to connect to an OBEX server.

Connecting to an OBEX Server

5. Call Putto send the data object to the server. This method returns destination pointer to the IStreaminterface, which is used to write the data.

Headers to Use with Put Operations

6. Call IStream::Writeto write into the stream.

Note:
To verify that the Putoperation has completed, call IStream::Commitbefore you close the operation.

Use of Streams

7. Close the connection to the OBEX server by calling the IObexDevice::Disconnecton the IObexDevicereference.

Disconnecting from an OBEX Server

8. Release all interfaces and allocated resources.

  • Call the IObex::Shutdownmethod to release IObex.

  • Call the standard COM Releasemethod to release all other interfaces.

None.

See Also