Using Win32 functions in Visual FoxPro Image Gallery
Message and Message Queue
..msdn
BroadcastSystemMessage
GetQueueStatus
MQCloseQueue
MQDeleteQueue
MQHandleToFormatName
MQOpenQueue
MQPathNameToFormatName
MQPurgeQueue
PeekMessage
PostMessage
PostQuitMessage
SendMessage
Code examples:
MSMQ: how to open a queue
MQPathNameToFormatName
..msdn    Add comment     W32 Constants      Translate this page
Returns a format name based on the path name provided.
Code examples:
MSMQ: how to open a queue
Declaration:
HRESULT APIENTRY MQPathNameToFormatName(
  LPCWSTR lpwcsPathName,  
  LPWSTR lpwcsFormatName,  
  LPDWORD lpdwCount       
);
FoxPro declaration:
DECLARE INTEGER MQPathNameToFormatName IN mqrt;
    STRING lpwcsPathName,;
    STRING @lpwcsFormatName,;    
    INTEGER @lpdwCount
Parameters:
lpwcsPathName
[in] UNC or DNS path name of the queue. Either private or public Message Queuing 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).
Return value:
MQ_OK (0) indicates success.
Usage:
* note cQueueName must be a Unicode string
* cQueueName = STRCONV(".\private$\mytestqueue" + CHR(0), 5)

nLength = 0
= MQPathNameToFormatName(;
    cQueueName, NULL, @nLength)

* allocating a buffer, Unicode
cFormatName = REPLICATE(CHR(0), nLength * 2)

nResult = MQPathNameToFormatName(;
    cQueueName, @cFormatName, @nLength)

IF nResult = 0  && MQ_OK
    ? STRTRAN(cFormatName, CHR(0), "")
ENDIF
My comment:
See also: MQHandleToFormatName, MQOpenQueue

MQPathNameToFormatName fails if a queue does not exist, not accessible, the name is invalid etc.

#DEFINE MQ_OK 0
#DEFINE MQ_ERROR_FORMATNAME_BUFFER_TOO_SMALL 0xC00E001F
#DEFINE MQ_ERROR_QUEUE_NOT_FOUND 0xC00E0003
#DEFINE MQ_ERROR_INVALID_HANDLE 0xC00E0007
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
Created: 2015-06-23 15:05:02
Modified: 2015-06-30 14:12:34
Visited in last 7 days: 63
User Contributed Notes:
There are no notes on this subject.


Copyright 2001-2017 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

Privacy policy
Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.6.37), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (54.158.212.93)
13 sec.Function: 'SQLFreeHandle'
25 sec.Function: 'NetConnectionEnum'
38 sec.Function: 'SetMonitorContrast'
51 sec.Function: 'waveInGetNumDevs'
1.08 min.Function: 'FindVolumeClose'
1.28 min.Function: 'GetInterfaceInfo'
1.5 min.Function: 'CeGetTempPath'
1.75 min.Function: 'FindFirstPrinterChangeNotification'
1.97 min.Function: 'CreateMD5SSOHash'
2.18 min.Function: 'GetUserObjectInformation'
Google
Advertise here!