Partager via


PROPID_Q_PATHNAME (Windows Embedded CE 6.0)

1/6/2010

Required (to create the queue). This property specifies the MSMQ path name of the queue, which includes the following:

  • The name of the computer where messages belonging to the queue are stored
  • An optional PRIVATE$ key word indicating if the queue is private
  • The name of the queue
  • Type Indicator
    VT_LPWSTR
  • PROPVARIANT Field
    pwszVal
  • Property Values
    MSMQ path name.

Remarks

The PROPID_Q_PATHNAME property is the only property required when creating a queue.

To specify the path name of the queue, specify PROPID_Q_PATHNAME in the MQQUEUEPROPS structure and call MQCreateQueue.

An MQ_ERROR_PROPERTY_NOTALLOWED error is returned if an attempt is made to set this property after the queue is created.

When specifying the name of the computer, use its NetBIOS or full DNS name.

The maximum length of the name of the queue is 124 Unicode characters; however, using names longer than 64 Unicode characters can slightly reduce performance.

The following example shows a MSMQ path name for a private queue.

myMachine\Private$\myPrivateQueue

As a shortcut, substitute a period "." for the local computer. Then, myPrivateQueue could be specified on the local computer, as shown:

.\Private$\myPrivateQueue

Private queues are only created on the local computer.

The application must ensure that all queue names on the local computer are unique.

If a queue name exists when MQCreateQueue is called, MSMQ returns an MQ_ERROR_QUEUE_EXISTS error to the application.

To retrieve the MSMQ path name of a queue, specify PROPID_Q_PATHNAMEin the MQQUEUEPROPS structure; then call MQGetQueueProperties and examine its returned value.

When specifying PROPID_Q_PATHNAME in the MQQUEUEPROPS structure, set its type indicator to VT_NULL. This tells MSMQ to allocate the memory needed for the path name.

When you finish using the queue, free the allocated memory with MQFreeMemory.

Examples

The following examples show how PROPID_Q_PATHNAME is specified in the MQQUEUEPROPS structure for setting and retrieving the path name of the queue. When retrieving the path name of the queue, the type indicator is set to VT_NULL.

To set the path name of a queue

LPWSTR wszPathName = L".\\private$\\TestQueue";
aPropID[i] = PROPID_Q_PATHNAME;             // Property identifier
aVariant[i].vt = VT_LPWSTR;                 // Type indicator
aVariant[i].pwszVal = wszPathName;          // Pathname of queue

To retrieve the path name of a queue

aPropID[i] = PROPID_Q_PATHNAME;             // Property identifier
aVariant[i].vt = VT_NULL;                   // Type indicator
i++;

Note

OS versions prior to 2.12 require the MSMQ add-on pack.

Requirements

Header mq.h
Windows Embedded CE Windows CE 2.0 and later

See Also

Reference

MSMQ Properties
MQCreateQueue
MQFreeMemory
MQGetQueueProperties
MQQUEUEPROPS