(Read-only, introduced in MSMQ 3.0.) The PROPID_MGMT_MSMQ_CONNECTED property indicates whether the queue manager on the computer has been disconnected from the network by calling MQMgmtAction with the argument L"DISCONNECT" as the action to be performed on the computer, by calling MSMQApplication.Disconnect, or by taking Message Queuing offline in the user interface. If the queue manager has been disconnected in one of these ways, it will not attempt to connect to the network and access the directory service.
One of the following Unicode strings:
The queue manager has not been disconnected from the network and will attempt to access the directory service (default). This value also corresponds to a computer operating in workgroup mode, which is not connected to the directory service, unless it was disconnected programmatically or by taking Message Queuing offline in the user interface.
The queue manager has been disconnected from the network and will not attempt to access the directory service.
Calling MQMgmtAction with the argument L"CONNECT" as the action to be performed on the computer, calling MSMQApplication.Connect, or bringing Message Queuing back online in the user interface restores the computer to the CONNECTED state. The queue manager will then attempt to connect to the network and access the directory service.
To retrieve a string that indicates whether the queue manager on the computer has been disconnected from the network, include PROPID_MGMT_MSMQ_CONNECTED D in the MQMGMTPROPS structure, and then call MQMgmtGetInfo.
When specifying PROPID_MGMT_MSMQ_CONNECTED in the MQMGMTPROPS structure, set its type indicator to VT_NULL. During the function call, Message Queuing automatically changes the type indicator to VT_LPWSTR and creates the string buffer needed to receive the property value. After you no longer need the string buffer, you must free the memory allocated for it using MQFreeMemory.
Equivalent COM Property
When using COM components, you can determine whether a computer has been disconnected from the network using the MSMQApplication.IsConnected property.
The following code fragment shows how PROPID_MGMT_MSMQ_CONNECTED is specified in arrays that can be used to initialize an MQMGMTPROPS structure.
aMgmtPropID[i] = PROPID_MGMT_MSMQ_CONNECTED; // Property identifier aMgmtPropVar[i].vt = VT_NULL; // Type indicator i++;
The following line of code shows how to free the memory allocated for the property value.