Platform SDK: Active Directory, ADSI, and Directory Services

IADsPrintQueueOperations::PrintJobs

The IADsPrintQueueOperations::PrintJobs method gets an IADsCollection interface pointer on the collection of the print jobs being processed in this print queue. This collection can be enumerated using the standard Automation enumeration methods on IEnumVARIANT. To delete a print job, use the IADsCollection::Remove method on the retrieved interface pointer.

HRESULT IADsPrintQueueOperations::PrintJobs(
IADsCollection ** ppPrintJobs  
);

Parameters

ppPrintJobs
[out] Indirect pointer to the IADsCollection interface on the collection of objects that have been added to this print queue. Objects in the collection implements the IADsPrintJob interface.

Return Values

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

Code Example [Visual Basic]

The following Visual Basic code fragment retrieves the collection object holding all the print jobs and then walk through each print job in the print queue.

Dim pqo As IADsPrintQueueOperations
Dim pjs as IADsCollection
 
Set pqo = GetObject("WinNT://aMachine/aPrinter")
Set pjs = pqo.PrintJobs
For each pj in pjs
MsgBox pj.TotalPages
Next

Example Code [C++]

For a C++ code snippet using the IADsPrintQueueOperations::PrintJobs method, see the code snippet given in IADsPrintJob Property Methods.

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

ADsEnumerateNext, IADsCollection, IADsCollection::Remove, IADsPrintJob, IADsPrintJob Property Methods, IADsPrintQueueOperations, IEnumVARIANT