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

Message Queuing supports sending and receiving serialized objects that support IPersistStreamand IPersistStorage. Many persistent objects, such as all Microsoft Office documents, can be sent as the body of an Message Queuing message.

When sending an object as the body of a message, Message Queuing seamlessly invokes the object's IPersistinterface. In this way, when the message is sent, the persistent state of the object is serialized into the message body using the object's supplied IPersistinterface.

At the receiving end, an implementation of the object's interface must be installed to use the object when it is removed from the queue.

The following example sends a Microsoft® Word 8.0 document to a destination queue. This code could be modified to send any persistent object.

To send a Microsoft Word 8.0 document
  1. Make sure that Microsoft Word 8.0 is installed on your computer.

  2. Add a reference to Microsoft Word 8.0. Create a destination queue and open it with send access.

  3. Create the Microsoft Word document object.

  4. Create and send a message. Set the body of the message to the document object.

  5. Open the queue with receive access and retrieve the message.

  6. Create a new object using the body of the retrieved message.

See Also