MSMQApplication.IsConnected
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
(Introduced in MSMQ 3.0.) The IsConnected property of the MSMQApplication object returns a Boolean equal to False (0) if the queue manager on the computer has been disconnected from the network by MSMQApplication.Disconnect, by the equivalent API function, 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. This property indicates whether the queue manager will attempt to access the directory service when connectivity exists.
Data type: | Boolean |
Run-time access: | Read-only |
Property IsConnected As Boolean
Property Value
True (-1)
The local queue manager will attempt to connect to the network and access the directory service when connectivity exists. This value is also returned for a computer operating in workgroup mode unless it was disconnected by MSMQApplication.Disconnect, by the equivalent API function, or by taking Message Queuing offline in the user interface.
False (0)
The local queue manager has been disconnected from the network by MSMQApplication.Disconnect, by the equivalent API function, or by taking Message Queuing offline in the user interface and will not attempt to connect to the network and access the directory service.
Error Codes
For information on return codes, see Message Queuing Error and Information Codes.
Remarks
Including the MSMQApplication object in the code syntax is optional because this object is defined as the application object, whose methods and properties are globally available.
This property (by default) applies to the local computer. To reference a remote computer, set MSMQApplication.Machine to the name of the remote computer and then look at this property.
Calling MSMQApplication.Connect, calling the API function MQMgmtAction with the argument "CONNECT" as the action to be performed on the computer, or bringing Message Queuing back online in the user interface prompts it to attempt to connect to the network and access the directory service.
In C++ COM applications, you must use a smart pointer to the IMSMQApplication3 interface to expose the IsConnected property.
Equivalent API Function Property
With API functions, the equivalent property is PROPID_MGMT_MSMQ_CONNECTED.
Requirements
Windows NT/2000/XP: Included in Windows XP and Windows Server 2003.
Windows 95/98/Me:Unsupported.
Header: Declared in Mqoai.h.
Library: Use Mqoa.lib.
See Also
MSMQApplication
MSMQApplication.Connect
MSMQApplication.Disconnect
MSMQApplication.Machine
PROPID_MGMT_MSMQ_CONNECTED