Directory Services |
Property methods for the IADsPrintJob interface get or set the properties described in the following table. For more information, see Interface Property Methods.
Property | Description |
---|---|
Description
[Visual Basic] [C++] |
The description of the print job. |
HostPrintQueue
[Visual Basic] [C++] |
The ADsPath string of the Print Queue that processes the print job. |
Notify
[Visual Basic] [C++] |
The user to be notified when job is completed. |
NotifyPath
[Visual Basic] [C++] |
The ADsPath string of the user object to be notified when the print job is completed. |
Priority
[Visual Basic] [C++] |
The priority of the print job. |
Size
[Visual Basic] [C++] |
The size, in bytes, of the print job. |
StartTime
[Visual Basic] [C++] |
The earliest time when the print job should be started. |
TimeSubmitted
[Visual Basic] [C++] |
The time when the job was submitted to the queue. |
TotalPages
[Visual Basic] [C++] |
The total number of pages in the print job. |
UntilTime
[Visual Basic] [C++] |
The latest time when the print job should be started. |
User
[Visual Basic] [C++] |
The name of user who submitted the print job. |
UserPath
[Visual Basic] [C++] |
The ADsPath string of the user object that submitted this print job. |
The following code example shows how to work with properties of a print job object.
Dim pqo As IADsPrintQueueOperations Dim pj As IADsPrintJob On Error GoTo Cleanup Set pqo = GetObject("WinNT://aMachine/aPrinter") For Each pj In pqo.PrintJobs MsgBox "Host Printer: " & pj.HostPrintQueue MsgBox "Job description: " & pj.Description MsgBox "job requester: " & pj.User Next Cleanup: If (Err.Number<>0) Then MsgBox("An error has occurred. " & Err.Number) End If Set pqo = Nothing Set pj = Nothing
The following code example shows how to work with properties of a print job object.
IADsPrintQueueOperations *pqo = NULL; IADsPrintJob *pJob = NULL; HRESULT hr = S_OK; BSTR bstr = NULL; VARIANT var; ULONG lFetch = 0; IDispatch *pDisp = NULL; IADsCollection *pColl = NULL; IUnknown *pUnk = NULL; LPWSTR adsPath =L"WinNT://aMachine/aPrinter"; VariantInit(&var); hr = ADsGetObject(adsPath, IID_IADsPrintQueueOperations, (void**)&pqo); if(FAILED(hr)){goto Cleanup;} hr = pqo->PrintJobs(&pColl); // Enumerate print jobs. Code omitted. hr = pColl->get__NewEnum(&pUnk); if(FAILED(hr)){goto Cleanup;} IEnumVARIANT *pEnum; hr = pUnk->QueryInterface(IID_IEnumVARIANT,(void**)&pEnum); if(FAILED(hr)){goto Cleanup;} // Now Enumerate. hr = pEnum->Next(1, &var, &lFetch); if(FAILED(hr)){goto Cleanup;} while(hr == S_OK) { if (lFetch == 1) { pDisp = V_DISPATCH(&var); pDisp->QueryInterface(IID_IADsPrintJob, (void**)&pJob); pJob->get_HostPrintQueue(&bstr); printf("HostPrintQueue: %S\n",bstr); SysFreeString(bstr); pJob->get_Description(&bstr); printf("Print job name: %S\n",bstr); SysFreeString(bstr); pJob->get_User(&bstr); printf("Requester: %S\n",bstr); SysFreeString(bstr); pJob->Release(); } pDisp->Release(); VariantClear(&var); hr = pEnum->Next(1, &var, &lFetch); }; Cleanup: if(pEnum) pEnum->Release(); if(pUnk) pUnk->Release(); if(pColl) pColl->Release(); if(pqo) pqo->Release();
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.