NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

MessageQueue.Send

[To be supplied.]

Overload List

Sends an object to the queue referenced by this MessageQueue. The object is serialized using the formatter provided.

[Visual Basic] Overloads Overridable Public Sub Send(Object)
[C#] public virtual void Send(Object);
[C++] public: virtual void Send(Object*);
[JScript] public function Send(Object);

Sends an object to the queue referenced by this MessageQueue. The object will be serialized using the formatter provided.

[Visual Basic] Overloads Overridable Public Sub Send(Object, String)
[C#] public virtual void Send(Object, String);
[C++] public: virtual void Send(Object*, String);
[JScript] public function Send(Object, String);

Example [Visual Basic]

The following example sends an object defined by a structure to a message queue. This example assumes there is a queue named "myQueue" on the computer "myComputer". It also assumes that there is a structure named MyNewObject with the members Item and Quantity.

Note   This example shows how to use one of the overloaded versions of Send. For other examples that may be available, see the individual overload topics.

[Visual Basic]

Structure MyNewObject
    Public Item As String
    Public Quantity As Integer
End Structure

Private Sub SendObject()
    'Create a new Order object.
    Dim myNewObject1 As MyNewObject
    Dim messageQueue1 As MessageQueue
    messageQueue1 = New MessageQueue("myComputer\myQueue")
    'Populate the structure's members.
    myNewObject1.Item = "new item"
    myNewObject1.Quantity = 1
    'Send the structure to the message queue.
    messageQueue1.Send(myNewObject1)
End Sub

See Also

MessageQueue Class | MessageQueue Members | System.Messaging Namespace