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 sends a message to one or more destination queues.

Syntax

HRESULT.Send( 
  MSMQQueue* 
DestinationQueue, 
  VARIANT* 
Transaction
)

Parameters

DestinationQueue

Reference to an MSMQDestinationor MSMQQueueInfoobject.

Transaction

Message to send.

Return Value

The following table describes the common return values.

Value Description

S_OK

Success

E_INVALIDARG

One or more arguments are invalid

E_NOTIMPL

The function contains no implementation

E_OUTOFMEMORY

Out of memory

Remarks

Each Message Queuing message can have no more than 4 MB of data.

To get the handle of a queue, use the MSMQQueue.Handleproperty of the queue.

To save a copy of the message in a computer journal, set MSMQMessage.Journalto MQMSG_JOURNAL.

Messages that do not reach their destination can be sent to a dead-letter queue by setting the message's MSMQMessage.Journalproperty to MQMSG_DEADLETTER.

When sending messages using Send, you cannot specify the type of message body included in the message. Message Queuing determines the body type and sets the message body type property for you. (The body type property of the message can be accessed only with Message Queuing functions).

Sending Message to Multiple Destinations

To send a message to multiple destinations (introduced in MSMQ 3.0), the DestinationQueue parameter must reference an MSMQDestinationobject.

Responding to Messages

The sending application can request a response by providing the format name of a response queue when it sends the message. The format name is specified in the MSMQMessage.ResponseQueueInfoproperty when the message is sent.

Requirements

Header mqoai.h
Library mqoa.lib
Windows Embedded CE Windows CE .NET 4.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also