The MQPathNameToFormatName function returns a format name based on the MSMQ pathname provided.
HRESULT APIENTRY MQPathNameToFormatName(
LPCWSTR lpwcsPathName,
LPWSTR lpwcsFormatName,
LPDWORD lpdwCount
);
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.
Private (local only) and public MSMQ pathnames can be specified.
Typically, this function is used when the only available information is the queue's MSMQ pathname and you need the format name for calls to MQOpenQueue, MQGetQueueProperties, MQSetQueueProperties, MQGetQueueSecurity, or MQSetQueueSecurity.
The format name of a public queue cannot be retrieved if there is no connection to Active Directory. This restriction applies to dependent client computers, independent client computers that are working offline, and MSMQ routing servers (FRS). (For information on offline operations, see MSMQ Offline Support.)
Other format name translation functions include MQInstanceToFormatName and MQHandleToFormatName.
For an example of using MQPathNameToFormatName, see Sending Private Messages.
Windows NT: Requires version 4.0 SP3 or later.
Windows: Requires Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in mq.h.
Import Library: Use mqrt.lib.
Unicode: Defined only as Unicode.
MQGetQueueProperties, MQGetQueueSecurity, MQHandleToFormatName, MQInstanceToFormatName, MQOpenQueue, MQSetQueueProperties, MQSetQueueSecurity