Description
Sets the outflow state of the named queue to "STOPPED". If jobs are running in the queue, the state is set to "STOPPING" until the jobs complete, and then it is set to "STOPPED". The caller must have operator privileges on the server.
Syntax
DWORD BatchStopQueue(LPCTSTR queuename);
Parameter
LPCTSTR queuename |
Specifies the name of the queue to stop. |
Return Values
BATCH_ERROR_NO_SUCH_QUEUE |
The queue does not exist. |
BATCH_ERROR_BAD_QUEUE_NAME |
The syntax of the queue name was not valid. |
BATCH_ERROR_OPERATOR_ACCESS_DENIED |
The user does not have operator privileges. |
Example Program
#include <iostream.h>
#include "batchapi.h"
#define MAX_LENGTH 25
void main()
{
char * pTemp;
LPCTSTR QueName;
DWORD ReturnVal;
cout << " STARTING THE EXECUTION OF BATCHSTOPQUEUE API"<< endl;
pTemp = new char[ MAX_LENGTH];
if (pTemp == NULL){
cout << "unable to allocate the memory.\n Exiting the program"<<endl;
exit(0);
}
cout << " Enter the name of the QUEUE to start"<< endl;
cin >> pTemp;
QueName = (const char *)pTemp;
ReturnVal = BatchStopQueue(QueName);
switch(ReturnVal)
{
case BATCH_ERROR_NO_SUCH_QUEUE :
cout << " The queue does not exist. " << endl;
break;
case BATCH_ERROR_BAD_QUEUE_NAME :
cout << " The syntax of the queue name was not valid. " << endl;
break;
case BATCH_ERROR_OPERATOR_ACCESS_DENIED :
cout << " The user does not have operator privileges. " << endl;
break;
default:
cout << "SUCCESSFUL COMPLETION OF STOPPING THE QUEUE " << endl;
}
cout << " COMPLETED THE EXECUTION OF BATCHSTOPQUEUE API"<< endl;
delete [] pTemp;
}