MSMQApplication.Connect

 

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
()  

Parameters

This method has no parameters.

Return Values

This method has no return values.

Error Codes

This method generates one of the following error codes:

MQ_OK (0)

The method call was successful.

MQ_ERROR_ACCESS_DENIED (0xC00E0025)

The access rights for performing management actions on the computer are not allowed for the calling process.

MQ_ERROR_SERVICE_NOT_AVAILABLE (0xC00E000B)

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.

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.

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.

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.