PROPID_M_ADMIN_QUEUE

The PROPID_M_ADMIN_QUEUE property specifies the administration queue used for MSMQ-generated acknowledgment messages.

Type Indicator
VT_LPWSTR
PROPVARIANT Field
pwszVal
Property Values
Format name of administration queue.

Remarks

The administration queue can be any non-transaction queue. The acknowledgment messages sent to the queue can indicate if the original message reached its destination queue or is read from the queue. Acknowledgment messages are generated and sent 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.

Example

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
    //
    }
 

QuickInfo

  Windows NT: Requires version 4.0 SP3 or later.
  Windows: Requires Windows 95 or later.
  Windows CE: Unsupported.
  Header: Declared in mq.h.
  Import Library: Use mqrt.lib.
  Unicode: Defined only as Unicode.

See Also

MQReceiveMessage, MQSendMessage, PROPID_M_ACKNOWLEDGE, PROPID_M_ADMIN_QUEUE_LEN