home *** CD-ROM | disk | FTP | other *** search
-
- <!-- #include virtual="/quickstart/howto/include/header.inc" -->
-
- <h4>How Do I...Pass a complex type through a message queue?</h4>
-
- <div class="indent" style="width:660">
- <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; WORD-SPACING: 0px"><font face="Tahoma" size="1">Message
- queuing makes it easy for application developers to communicate with application
- programs quickly and reliably by sending and receiving messages. Messaging
- provides you with guaranteed message delivery and a robust, fail-safe way to
- carry out many of your business processes.<br>
- <br>
- The MessageQueue component allows you to easily incorporate message-based
- communication into your applications. Using this component and its associated
- language features, you can send and receive messages, explore existing queues,
- create and delete queues, and perform a variety of other operations using a
- simple programming model.<br>
- <br>
- The sample illustrates how to use the MessageQueue component to send a complex
- type through a message queue. To run the sample you have to have Message
- Queuing installed on your system.<br>
- <br>
- Sending a complex type through a queue is very simple. It's actually as simple
- as sending a string (see MQSend sample). The MessageQueue component handles
- everything automatically. All you have to do is:</font></p>
- <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; WORD-SPACING: 0px"> </p>
- <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; WORD-SPACING: 0px"><font face="Tahoma" size="1">1.
- Create an instance of the MessageQueue component and set its Path property:</font></p>
- <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; WORD-SPACING: 0px"> </p>
- <blockquote>
- <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; WORD-SPACING: 0px"><font face="Courier New" color="#0000ff" size="2">MessageQueue
- mq = new MessageQueue(".\\MyQueue");</font></p>
- </blockquote>
- <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; WORD-SPACING: 0px"> </p>
- <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; WORD-SPACING: 0px"><font face="Tahoma" size="1">2.
- Calling Send method to send a complex object:</font></p>
- <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; WORD-SPACING: 0px"> </p>
- <blockquote>
- <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; WORD-SPACING: 0px"><font face="Courier New" color="#0000ff" size="2">MyComplexType
- myType = new MyComplexType();</font></p>
- <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; WORD-SPACING: 0px"><font face="Courier New" color="#0000ff" size="2">mq.Send(myType);</font></p>
- </blockquote>
- <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; WORD-SPACING: 0px"><font face="Tahoma" size="1">Have
- a good time MessageQueue'ing!</font></p>
-
- </div>
-
- <h4>Example</h4>
-
- <p>
- <div class="indent">
- <a target="_blank" href="/quickstart/howto/samples/Services/MessageQueue/SendObject">
- <img style="border-color:black" border=1 src="/quickstart/images/genicon.gif"><br>
- </a>
- <div class="caption">SendObject.exe</div><br>
- [<a target="_blank" href="/quickstart/howto/samples/Services/MessageQueue/SendObject">View Sample</a>] |
- [<a target="_blank" href="/quickstart/util/srcview.aspx?path=/quickstart/howto/samples/Services/MessageQueue/SendObject/SendObject.src">View Source</a>]<p>
- </div>
-
- <h4>Source Code</h4>
-
- <div class="code">
- <xmp>
- <!-- #include virtual="/quickstart/howto/samples/Services/MessageQueue/SendObject/SendObject.cs" -->
- </xmp>
- </div>
-
- <!-- #include virtual="/quickstart/howto/include/footer.inc" -->