次の方法で共有


MSMQMessage.Id (Compact 2013)

3/26/2014

This read-only property identifies the message using an MSMQ-generated message identifier.

Syntax

HRESULT get_HashAlgorithm( 
  VARIANT* pvarMsgId 
);

Parameters

  • pvarMsgId
    20-byte message identifier (array of bytes).

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

Message Queuing generates a 20-byte message identifier when the message is sent. This includes application-generated messages sent by applications and system-generated messages sent by Message Queuing.

The message identifier is composed of the machine GUID of the sending computer plus an additional identifier that is unique to the computer. By combining these two components, the message identifier is unique for each message.

Sending messages to multiple destinations

When messages are sent to multiple destinations by means of distribution lists, multicast addresses, and multiple-element format names, only one identifier is generated for all the messages sent.

For example, if a distribution list is used to send a message to three destinations all three messages will have the same message identifier.

To distinguish between messages with the same identifier, the application looking at the messages must also check the unique destination of each message.

Message identifiers in acknowledgment messages

When an acknowledgment message is created, the message identifier of the original message can be found in the MSMQMessage.CorrelationId property of the acknowledgment message.

Message identifiers in response messages

When sending response messages, MSMQMessage.CorrelationId can be set to the message identifier of the message that is in the queue. This provides an easy mechanism that the sending application can use to match the response message with the message that was sent.

Visual Basic arrays

When dimensioning arrays for the message identifier, always set the lower boundary of the array to 0.

When filling in the identifier, Message Queuing sets the lower boundary of the returned byte-array to 0 regardless of what boundary was set by the application.

Equivalent Function property

When using functions, the identifier of the message can be set and retrieved using the PROPID_M_MSGID property.

Requirements

Header

mqoai.h

Library

mqoa.lib

See Also

Reference

MSMQMessage
MSMQMessage.CorrelationId
PROPID_M_MSGID