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 Connect method of the MSMQApplication object connects the computer to the network and to the directory service server.
Sub Connect ()
This method has no parameters.
This method has no return values.
This method generates one of the following error codes:
The method call was successful.
The access rights for performing management actions on the computer are not allowed for the calling process.
The application is unable to connect to the queue manager.
For a complete list of error and information codes, see Message Queuing Error and Information Codes.
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.
Local administrative permissions are needed to connect the queue manager on a computer to the network and to the directory service server.
In C++ COM applications, you must use a smart pointer to the IMSMQApplication3 interface to expose the Connect method.
Equivalent API Function
When using API functions, call MQMgmtAction and pass "CONNECT" as the string indicating the action to be performed on the computer, to connect the computer to the network and to the directory service server.
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.