Platform SDK: Active Directory, ADSI, and Directory Services |
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 );
This method supports the standard return values. For other return values see the ADSI Error Codes.
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
For a C++ code snippet using the IADsPrintQueueOperations::PrintJobs method, see the code snippet given in IADsPrintJob Property Methods.
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.
ADsEnumerateNext, IADsCollection, IADsCollection::Remove, IADsPrintJob, IADsPrintJob Property Methods, IADsPrintQueueOperations, IEnumVARIANT