Share via


PROPID_QM_MACHINE_ID

 

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

(Read-only.) The PROPID_QM_MACHINE_ID property identifies the computer.

Property ID

PROPID_QM_MACHINE_ID

Type Indicator

VT_CLSID

MQPROPVARIANT Field

puuid

Property Value

Computer GUID.

Remarks

The PROPID_QM_MACHINE_ID property is a globally unique identifier (GUID) set by Message Queuing when the computer is defined (for dependent clients, Message Queuing sets this property to the identifier of the client's supporting server).

The PROPID_QM_MACHINE_ID property is used when specifying a private format name for a private queue or a machine format name for the computer journal or a dead-letter queue. For information on the syntax of machine format names, see Machine and Connector Format Names.

To retrieve the identifier of the computer, include PROPID_QM_MACHINE_ID in the MQQMPROPS structure, and then call MQGetMachineProperties and examine the returned property value.

When specifying PROPID_QM_MACHINE_ID in the MQQMPROPS structure, the type indicator can be set to VT_CLSID or VT_NULL. If you set the type indicator equal to VT_NULL, Message Queuing automatically changes the type indicator to VT_CLSID and allocates memory for the buffer needed during the function call. A pointer to this buffer is stored in the puuid field of the MQPROPVARIANT structure. In that case, after you no longer need the buffer, you must free the memory allocated for it using MQFreeMemory.

Equivalent COM Property

To retrieve the computer GUID using COM components, call the MSMQApplication.MachineIdOfMachineName method.

Example Code

The following code fragment shows how PROPID_QM_MACHINE_ID is specified in the MQQMPROPS structure.

CLSID guidMachineId;                         // Computer GUID buffer  
aQMPropId[i] = PROPID_QM_MACHINE_ID;         // Property identifier  
aQMPropVar[i].vt = VT_CLSID;                 // Type indicator  
aQMPropVar[i].puuid = &guidMachineId;  

The following example is included in Using Message Queuing.

For an example of See
Retrieving the computer GUID for reading messages in the computer journal C/C++ Code Example: Reading Messages in the Computer Journal

See Also

Queue Manager Properties
MQFreeMemory
MQGetMachineProperties
MQQMPROPS
MSMQApplication.MachineIdOfMachineName