IADsPrintQueueOperations::Purge method

The IADsPrintQueueOperations::Purge method clears the print queue of all print jobs without processing them.

Syntax


HRESULT Purge();

Parameters

This method has no parameters.

Return value

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

Examples

The following code example removes all the print jobs from a printer.


Dim pqo As IADsPrintQueueOperations
On Error GoTo Cleanup

Set pqo = GetObject("WinNT://aMachine/aPrinter")
pqo.Purge

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


The following code example removes all the print jobs from a printer.


IADsPrintQueueOperations *pqo = NULL;
HRESULT hr = S_OK; 

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

if(FAILED(hr)) {goto Cleanup;}
hr = pqo->Purge();

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

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2008

Header

Iads.h

DLL

Activeds.dll

IID

IID_IADsPrintQueueOperations is defined as 124BE5C0-156E-11CF-A986-00AA006BC149

See also

IADsPrintQueueOperations

 

 

Show: