Directory Services

IADsPrintQueueOperations::Pause

The IADsPrintQueueOperations::Pause method suspends the processing of print jobs within a print queue service.

HRESULT Pause();

Parameters

This method has no parameters.

Return Values

This method supports the standard return values. For more information about other return values, see the ADSI Error Codes.

Example Code [Visual Basic]

The following code example suspends the operation of a printer.

Dim pqo As IADsPrintQueueOperations
On Error GoTo Cleanup

Set pqo = GetObject("WinNT://aMachine/aPrinter")
If pgo.status = ADS_PRINTER_PRINTING Then
	pqo.Pause
End If

Cleanup:
	If (Err.Number<>0) Then
		MsgBox("An error has occurred. " & Err.Number)
	End If
	Set pqo = Nothing

Example Code [C++]

The following code example suspends the operation of a printer.

IADsPrintQueueOperations *pqo = NULL;
HRESULT hr = S_OK;
long status = 0;

hr = ADsGetObject(L"WinNT://aMachine/aPrinter",
		IID_IADsPrintQueueOperations,(void**)&pqo);

hr = pqo->get_Status(&status);

if(status == ADS_PRINTER_PRINTING) 
{
	pqo->Pause();
}

Cleanup:
	if(pqo) pqo->Release();

Requirements

Client: Included in Windows XP and Windows 2000 Professional.
Server: Included in Windows Server 2003 and Windows 2000 Server.
Redistributable: Requires Active Directory Client Extension on Windows NT 4.0 SP6a and Windows 95/98/Me.
Header: Declared in Iads.h.

See Also

IADsPrintQueueOperations, IADsPrintQueueOperations::Resume