Share via


MQPathNameToFormatName

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

This function returns a private direct format name based on the MSMQ path name provided.

Syntax

HRESULT APIENTRY MQPathNameToFormatName(
  LPCWSTR lpwcsPathName,
  LPWSTR lpwcsFormatName,
  LPDWORD lpdwCount
);

Parameters

  • lpwcsPathName
    [in] Path name of the queue. Only private MSMQ path names are valid.
  • lpwcsFormatName
    [out] Pointer to a buffer to receive the format name for the queue.
  • lpdwCount
    [in, out] On input, specifies the length of the lpwcsFormatName buffer (in Unicode characters).

    Private queues require at least 54 characters.

    On output, indicates the length of the returned format name string, including the null-terminating character.

    If the output value is greater than the initial input value, the supplied buffer is not large enough to contain the complete format name string and MQ_ERROR_FORMATNAME_BUFFER_TOO_SMALL is returned. In this case, only a portion of the format name is returned.

Return Value

  • MQ_OK
    Indicates success.
  • MQ_ERROR_ILLEGAL_QUEUE_PATHNAME
    The lpwcsPathName parameter contains an illegal MSMQ path name string.
  • MQ_ERROR_SERVICE_NOT_AVAILABLE
    Cannot connect to the Queue Manager.
  • MQ_ERROR_FORMATNAME_BUFFER_TOO_SMALL
    The buffer pointed to by lpwcsFormatName is too small to contain the format name string.

Remarks

Private (local only) path names can be specified.

Typically, this function is used when the only available information is the queue's MSMQ path name and you need the format name for calls to MQOpenQueue, MQGetQueueProperties, or MQSetQueueProperties.

The other format name translation function supported is MQHandleToFormatName.

Note

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

Requirements

Header mq.h
Library msmqrt.lib
Windows Embedded CE Windows CE 2.0 and later
Windows Mobile Windows Mobile Version 5.0 and later
Note Versions prior to 2.12 require the MSMQ add-on pack

See Also

Reference

MQGetQueueProperties
MQHandleToFormatName
MQOpenQueue
MQSetQueueProperties