MSMQMessage.Send
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 MSMQDestination or MSMQQueueInfo object.
- 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.Handle property of the queue.
To save a copy of the message in a computer journal, set MSMQMessage.Journal to MQMSG_JOURNAL.
Messages that do not reach their destination can be sent to a dead-letter queue by setting the message's MSMQMessage.Journal property 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 MSMQDestination object.
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.ResponseQueueInfo property 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
Reference
MSMQMessage.Body
MSMQMessage.Journal
MSMQMessage.Label
MSMQMessage
MSMQQueue.Close
MSMQQueue.Handle
MSMQQueue
MSMQQueueInfo.Create
MSMQQueueInfo.Open
MSMQQueueInfo.PathName
MSMQQueueInfo