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 2.0.) The MSMQVersionMajor property of the MSMQApplication object provides the major version number of Message Queuing running on the computer.

Data type: Integer
Run-time access: Read-only
Property MSMQVersionMajor As Integer  

Property Value

An Integer containing the major version number of Message Queuing running on the computer.

Error Codes

For information on return codes, see Message Queuing Error and Information Codes.


The value of MSMQVersionMajor is a calculated value set by Message Queuing when the property is referenced. Message Queuing does not access the directory service to get this information.

To retrieve the minor and build version numbers of Message Queue, retrieve the MSMQApplication.MSMQVersionMinor and MSMQApplication.MSMQVersionBuild properties.

When you retrieve MSMQVersionMajor, you do not have to reference the MSMQApplication object explicitly because this object is defined as the application object, whose methods and properties are globally available. For example, the following lines of code both retrieve the major version number of Message Queuing.

intMajorVersion = MSMQVersionMajor  
intMajorVersion = MSMQApplication.MSMQVersionMajor  

This property applies only to the default (local) computer. If the application object references a specific computer (including the local computer), an MQ_ERROR_INVALID_PARAMETER error will be returned. You can use MSMQApplication.Machine to set the computer name to Null so that the application object will not reference a specific computer.

In C++ COM applications, you must use a smart pointer to the IMSMQApplication2 or IMSMQApplication3 interface to expose the MSMQVersionMajor property.

Equivalent API Function Property

With API functions, the equivalent property is PROPID_PC_VERSION.


Windows NT/2000/XP: Included in Windows 2000 and later.

Windows 95/98/Me: Unsupported.

Header: Declared in Mqoai.h.

Library: Use Mqoa.lib.

See Also