IProvQueue::QueryResults
Retrieves the XML result for a queued request. Used to query requests managed by the Provisioning Queue Manager Service of Microsoft. Provisioning Framework (MPF).
QueryResults only retrieves results for completed jobs. Before running QueryResults, you can run QueryStatus to find out whether the job is complete.
Syntax
C++ HRESULT QueryResults ( BSTR bstrQueueID, BSTR *bstrResults );Visual Basic Function QueryResults ( _ bstrQueueID As String _ ) As StringParameters
- bstrQueueID
- Queue ID of the query request. Returned by SubmitRequest or SubmitTrustedRequest.
- bstrResults (C++) / return value (VB)
- Result of the query request. If the call is successful, the result is a completed batch response in the format
<batchresponse> <response> . . . </response> </batchresponse>in which each <response> node corresponds to an action in the batch. For example, if the batch is<request> <data>request1</data> <data>request2</data> <data>request3</data> . . . </request>the response would be<batchresponse> <response>response1</response> <response>response2</response> <response>response3</response> </batchresponse>Return Codes
Zero indicates success; a non-zero value represents an error. For a list of error codes, see MPF Errors.
C++ Example
IProvQueue *pProvQueue = NULL; BSTR bstrRequest = NULL; BSTR bstrQueueID = NULL; BSTR bstrResults = NULL; HRESULT hr = E_OUTOFMEMORY; // The code for creating the queue manager client and the request string was skipped ... // Create a queued request hr = pProvQueue->SubmitTrustedRequest(bstrRequest, FALSE, &bstrQueueID); if(FAILED(hr)) goto LocalCleanup; // Wait for 10s or until the request succeeds for(int i = 0; i < 10; ++i) { hr = pProvQueue->QueryResults(bstrQueueID, &bstrResults); if(hr != E_QUEUE_NOT_DONE_PROCESSING) break; Sleep(1000); } if(bstrResults) MessageBoxW(NULL, bstrResults, L"Queued request result", MB_OK); else MessageBoxW(NULL, "The queued request didn't complete successfully within 10s", L"Queued request results", MB_OK); // Clean up LocalCleanup: if(pProvQueue) pProvQueue->Release(); ::SysFreeString(bstrRequest); ::SysFreeString(bstrQueueID); ::SysFreeString(bstrResults);Visual Basic Example
Dim objProvQueue Dim strRequest Dim strQueueID Dim status ' The code for creating the queue manager client and the request string was skipped ... ' Create a queued request strQueueID = objProvQueue.SubmitTrustedRequest(strRequest, False) ' Wait for 10s or until the request succeeds For I = 1 To 10 status = objProvQueue.QueryStatus(strQueueID) If status = 0 Or status = 1 Then Exit For End If Sleep(1000) Next I If status = 0 Then MsgBox objProvQueue.QueryResults(strQueueID) Else MsgBox "The queued request didn't complete successfully within 10s" End IfSee Also
Top of Page
) 1999-2002 Microsoft Corporation. All rights reserved.