Partilhar via


MSMQMessage.Destination

 

Applies To: Windows 10, Windows 7, Windows 8, Windows 8.1, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows Server Technical Preview, Windows Vista

(Introduced in MSMQ 3.0.) The Destination property of the MSMQMessage object provides the set of destination queues where the message was sent.

Data type: MSMQDestination
Run-time access: Read-only
Property Destination As MSMQDestination  

Property Value

An MSMQDestination object that represents a distribution list or multiple-element format name (in C++, a smart pointer to the IMSMQDestination interface).

Remarks

The Destination property is set by Message Queuing when the sending application sends the message using distribution lists or multiple-element format name.

Multiple destinations can be specified using distribution list or a multiple-element format names. Distribution lists are public lists that are published in Active Directory Domain Services (AD DS) and multiple element format names are private lists that are created and maintained at the application level. For information on distribution lists and multiple-element format names, see Multiple-Destination Messaging.

When multiple destinations are specified by the sending application, the receiving application can retrieve Destination to get the complete set of destinations, or retrieve MSMQMessage.DestinationQueueInfo to get the specific destination of the message. Message Queuing sets both properties when it sends messages to multiple destinations.

In C++ COM applications, you must use a smart pointer to the IMSMQMessage3 interface to expose the Destination property.

Equivalent API Function Property

With API function calls, the equivalent property is PROPID_M_DEST_FORMAT_NAME.

Example Code

The following code fragment shows how to retrieve the Destination property of a message as an MSMQDestination object that represents a distribution list or a multiple-element format name.

Dim dest As MSMQDestination  
Dim msg As MSMQMessage  
  
' TO DO: read the message.  
  
Set dest = msg.Destination  

Requirements

Windows NT/2000/XP: Included in Windows XP and Windows Server 2003

Windows 95/98/Me: Unsupported.

Header: Declared in Mqoai.h.

Library: Use Mqoa.lib

See Also

MSMQMessage
MSMQMessage.DestinationQueueInfo
PROPID_M_DEST_FORMAT_NAME