Partager via


PROPID_M_APPSPECIFIC

 

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

The PROPID_M_APPSPECIFIC property specifies application-generated information such as single integer values or application-defined message classes.

Property ID

PROPID_M_APPSPECIFIC

Type Indicator

VT_UI4

MQPROPVARIANT Field

ulVal

Property Value

Unsigned integer. The default is 0.

Remarks

Application-specific information can be used to organize different types of messages. For example, several sending applications may be sending messages to a common queue. If each application uses a different application-specific index, the receiving application can use PROPID_M_APPSPECIFIC to filter out the messages from a single sending application.

To set application-specific information, specify PROPID_M_APPSPECIFIC in the MQMSGPROPS structure and call MQSendMessage.

To retrieve application specific information, specify PROPID_M_APPSPECIFIC in the MQMSGPROPS structure. Then call MQReceiveMessage or MQReceiveMessageByLookupId and examine its returned value. When retrieving this property, the type indicator can be set to VT_UI4 or VT_NULL. If you set the type indicator to VT_NULL, Message Queuing automatically changes the type indicator to VT_UI4 during the function call.

In addition to application-specific information, you can use the PROPID_M_CORRELATIONID message property for filtering as well.

Equivalent COM Property

With COM components, the equivalent property for setting and retrieving application-specific information is MSMQMessage.AppSpecific.

Example Code

The following code fragment shows how PROPID_M_APPSPECIFIC is specified in arrays that can be used to initialize an MQMSGPROPS structure:

aMsgPropId[i] = PROPID_M_APPSPECIFIC;        // Property ID  
aMsgPropVar[i].vt = VT_UI4;                  // Type indicator  
aMsgPropVar[i].ulVal = dwAppspecificIndex;   // Value  
i++;  

The following example is included in Using Message Queuing.

For an example of See
Retrieving messages on the basis of application-specific information C/C++ Code Example: Application-Specific Filters

See Also

Message Properties
MQMSGPROPS
MQReceiveMessage
MQReceiveMessageByLookupId
MQSendMessage
PROPID_M_CORRELATIONID