Platform SDK: Active Directory, ADSI, and Directory Services

IADsPrintQueueOperations::Purge

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

HRESULT IADsPrintQueueOperations::Purge(void);

Return Values

This method supports the standard return values. For other return values see the ADSI Error Codes.

Example Code [Visual Basic]

The following Visual Basic code fragment removes all the print jobs from a printer.

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

Example Code [C++]

The following C++ code snippet removes all the print jobs from a printer.

IADsPrintQueueOperations *pqo;
HRESULT hr = ADsGetObject(L"WinNT://aMachine/aPrinter",
IID_IADsPrintQueueOperations,
(void**)&pqo)
hr = pqo->Purge();
hr = pqo->Release();

Requirements

  Windows NT/2000: Requires Windows 2000 (or Windows NT 4.0 with DSClient).
  Windows 95/98: Requires Windows 95 or later (with DSClient).
  Header: Declared in Iads.h.

See Also

IADsPrintQueueOperations