The MQLocateNext function retrieves the requested queue information from the query. It is called after obtaining a query handle from a previous call to MQLocateBegin.
HRESULT APIENTRY MQLocateNext( HANDLE hEnum, DWORD * pcProps, PROPVARIANT aPropVar[] );
On return, pcProps holds the number of properties returned to the query. MQLocateNext returns as many completed sets of properties (the number of properties returned for each queue) as possible. A returned value of 0 indicates no queues were found.
The MQLocateNext function is called after obtaining a query handle from a previous call to MQLocateBegin. The call can be repeated, using the same query handle, until all the results of the query are received (until pcProps is 0). For a complete description of running a query, see Locating a Public Queue.
The MQLocateNext function returns as many completed results (the number of properties requested in MQLocateBegin) as possible. Consequently, you should always specify a multiple of the number of requested properties when setting pcProps. By using a multiple of the requested properties, allocated space for these properties is not wasted.
MSMQ only returns information for those queues that the calling application has access rights (MQSEC_GET_QUEUE_PROPERTIES) to.
MQLocateNext is not supported for offline operations. For information on offline operations, see MSMQ Offline Support.
For an example of using MQLocateNext, see Locating a Public Queue.
MQFreeMemory, MQGetQueueProperties, MQLocateBegin, MQLocateEnd, MQSetQueueSecurity