Sdílet prostřednictvím


MSMQApplication

 

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

The MSMQApplication object provides methods and properties that can be used to obtain information about the Message Queuing service on a computer. This object can be used to do the following:

  • Connect a computer to or disconnect a computer from the network.

  • Register a certificate in Active Directory Domain Services (AD DS).

  • Obtain the name or globally unique identifier (GUID) of a specified computer.

  • Clean up empty message files on a computer.

  • Obtain information about the Message Queuing installation on a computer.

Note

Creating a new instance of this object does not start a new instance of the Message Queuing service.

Methods

The MSMQApplication object defines the following methods.

Method Description
MSMQApplication.Connect (Introduced in MSMQ 3.0.) Connects the computer to the network and the directory service server.
MSMQApplication.Disconnect (Introduced in MSMQ 3.0.) Disconnects the computer from the network and the directory service server.
MSMQApplication.MachineIdOfMachineName Returns the globally unique identifier (GUID) for a specified computer.
MSMQApplication.MachineNameOfMachineId (Introduced in MSMQ 2.0.) Returns the name of a computer specified by its globally unique identifier (GUID).
MSMQApplication.RegisterCertificate (Introduced in MSMQ 2.0.) Registers an external or internal certificate in the directory service.
MSMQApplication.Tidy (Introduced in MSMQ 3.0.) Cleans up empty message files on a computer.

Properties

The MSMQApplication object defines the following properties.

Property Description
MSMQApplication.ActiveQueues (Introduced in MSMQ 3.0.) Returns the format names of all active queues on the computer.

Run-time access: Read-only

Data type: Variant (array of variants)
MSMQApplication.BytesInAllQueues (Read-only, introduced in MSMQ 3.0.) Returns the number of message bytes currently stored in all queues on the computer.

Run-time access: Read-only

Data type: Variant
MSMQApplication.DirectoryServiceServer (Introduced in MSMQ 3.0.) Returns the name of the current directory service server.

Run-time access: Read-only

Data type: Variant (String)
MSMQApplication.IsConnected (Introduced in MSMQ 3.0.) Returns a Boolean equal to False (0) if the queue manager on the computer has been disconnected from the network by 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.

Run-time access: Read-only

Data type: Boolean
MSMQApplication.IsDSEnabled (Introduced in MSMQ 2.0.) Indicates whether Message Queuing is configured to use the directory service.

Run-time access: Read-only

Data type: Boolean
MSMQApplication.Machine (Introduced in MSMQ 3.0.) Sets or returns the name of the computer to which the MSMQApplication object refers.

Run-time access: Read-write

Data type: String
MSMQApplication.MSMQVersionBuild (Introduced in MSMQ 2.0.) Returns the build number of the version of Message Queuing that is installed on the computer.

Run-time access: Read-only

Data type: Integer
MSMQApplication.MSMQVersionMajor (Introduced in MSMQ 2.0.) Returns the major version of Message Queuing that is installed on the computer.

Run-time access: Read-only

Data type: Integer
MSMQApplication.MSMQVersionMinor (Introduced in MSMQ 2.0.) Returns the minor version of Message Queuing that is installed on the computer.

Run-time access: Read-only

Data type: Integer
MSMQApplication.PrivateQueues (Introduced in MSMQ 3.0.) Returns the path names of all private queues registered on the computer.

Run-time access: Read-only

Data type: Variant (array of variants)

Remarks

Because MSMQApplication is a COM application object, you do not have to explicitly reference MSMQApplication when calling the methods and properties provided by the object. For example, the following three calls to MSMQApplication.MachineIdOfMachineName all return the same computer GUID.

Dim strId As String  
Dim myapp As New MSMQApplication  
  
strId = MachineIdOfMachineName
("machinename")  
Debug.Print strId  
  
strId = MSMQApplication.MachineIdOfMachineName
("machinename")  
Debug.Print strId  
  
strId = myapp.MachineIdOfMachineName
("machinename")  
Debug.Print strId  

Requirements

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

Windows 95/98/Me: Included in Windows 95 and later.

Header: Declared in Mq.h.

Library: Use Mqoa.lib.

See Also

Message Queuing COM Components