Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

To create a private queue, you must provide the pathname for the queue, plus additional queue properties needed by your application.

The pathname for a private queue contains the name of the local computer where the messages sent to the queue will be stored, the "PRIVATE$" keyword, and the name of the queue.

When providing the name of local computer, you can use the NetBIOS machine name, full DNS machine name, or a period (".") to designate the computer.

When providing a name for the queue, you can use any character except "\", ";" and "$" as the last character of the name. (Message Queuing reserves names ending with "$". For example, the token "PRIVATE$" is used to specify a private queue.)

The name of the queue is case-insensitive (for example, "MyQueue" and "myQueue" are treated as the same name) and can be up to 124 Unicode characters.

Note:
Queue names greater than 64 Unicode characters can cause a slight reduction in performance, and they are not easily displayed in Active Directory.
To create a private queue
  1. Declare the MSMQQueueInfovariable for the queue.

  2. Create a new MSMQQueueInfoobject and assign it to the variable.

  3. Specify the pathname of the queue.

    In these examples, "." is used to indicate the local computer.

    Note:
    For Message Queuing servers and independent clients, the local machine is the local computer. However, for Message Queuing–dependent clients, the local machine is the client's Message Queuing server.
  4. (Optional) Add additional queue properties that might be needed.

    The C++ COM code example also specifies the label of the queue.

  5. Call MSMQQueueInfo.Createto create the queue.

For a code example using C++ COM, see C++ COM Code Example: Creating a Private Queue.

See Also