The PROPID_M_ADMIN_QUEUE property specifies the queue used for MSMQ-generated acknowledgment messages.
Acknowledgment messages are sent to the administration queue by MSMQ. For more information, see Administration Queues.
To request acknowledgment messages, pass PROPID_M_ACKNOWLEDGE and PROPID_M_ADMIN_QUEUE to MQSendMessage.
To find out which queue is being used as the administration queue, pass PROPID_M_ADMIN_QUEUE and PROPID_M_ADMIN_QUEUE_LEN to MQReceiveMessage and examine the returned values.
To see how PROPID_M_ADMIN_QUEUE is used when sending messages, see Sending Messages that Request Acknowledgments.
The following example sets PROPID_M_ACKNOWLEDGE and PROPID_M_ADMIN_QUEUE as part of preparing MQMSGPROPS.
MQMSGPROPS MsgProps;
PROPVARIANT aVariant[10];
MSGPROPID aPropId[10];
DWORD PropIdCount = 0;
HRESULT hr;
QUEUEHANDLE hQueue;
//
// Set PROPID_M_ACKNOWLEDGE.
//
aPropId[PropIdCount] = PROPID_M_ACKNOWLEDGE; //PropId
aVariant[PropIdCount].vt = VT_UI1; //Type
aVariant[PropIdCount].bVal = MQMSG_ACKNOWLEDGMENT_FULL_RECEIVE; //Value
PropIdCount++;
//
// Set the PROPID_M_ADMIN_QUEUE property.
//
aPropId[PropIdCount] = PROPID_M_ADMIN_QUEUE; //PropId
aVariant[PropIdCount].vt = VT_LPWSTR; //Type
aVariant[PropIdCount].pwszVal = szwAdminFormatName; //An already obtained format name of the admin queue.
PropIdCount++;
//
// Set other message properties such as PROPID_M_BODY, PROPID_M_LABEL.
//
//
// Set the MQMSGPROPS structure
//
MsgProps.cProp = PropIdCount; //Number of properties.
MsgProps.aPropID = aPropId; //Ids of properties.
MsgProps.aPropVar = aVariant; //Values of properties.
MsgProps.aStatus = NULL; //No Error report.
//
// Send message.
//
hr = MQSendMessage(
hQueue, // handle to the Queue.
&MsgProps, // Message properties to be sent.
MQ_NO_TRANSACTION // No transaction
);
if (FAILED(hr))
{
//
// Handle error condition
//
}
MQReceiveMessage, MQSendMessage, PROPID_M_ACKNOWLEDGE, PROPID_M_ADMIN_QUEUE_LEN