Platform SDK: Active Directory, ADSI, and Directory Services |
The property methods of the IADsPrintQueue interface get or set the properties described in the following table. For more information, see Interface Property Methods.
Property | Description |
---|---|
BannerPage
[Visual Basic] [C++] |
The file system path that points to the banner page used to separate print jobs. If NULL, no banner page is used. |
Datatype
[Visual Basic] [C++] |
The data type that can be processed by this queue. |
DefaultJobPriority
[Visual Basic] [C++] |
The default priority assigned to each print job. |
Description
[Visual Basic] [C++] |
The text description of this print queue. |
HostComputer
[Visual Basic] [C++] |
The ADsPath string that references the host computer. |
Location
[Visual Basic] [C++] |
The location of the queue as described by an administrator. |
Model
[Visual Basic] [C++] |
The name of the driver used by this print queue. |
PrintDevices
[Visual Basic] [C++] |
A SAFEARRAY of BSTR that contains the names of the print devices to which this print queue spools jobs. |
PrinterPath
[Visual Basic] [C++] |
The string that references the path by which a shared printer can be accessed. |
PrintProcessor
[Visual Basic] [C++] |
The print processor associated with this queue. |
Priority
[Visual Basic] [C++] |
The priority of this printer object's job queue for any connected devices. All jobs in higher priority print queue objects will be processed before those in lower priority print queue objects. |
StartTime
[Visual Basic] [C++] |
The time when the queue should begin processing jobs. The date portion of the time is ignored. |
UntilTime
[Visual Basic] [C++] |
The time when the queue should stop processing jobs. |
The following Visual Basic code snippet shows how to determine if a specified printer is online or offline.
Dim pq as IADsPrintQueue Dim pqo as IADsPrintQueueOperations Set pq = GetObject("WinNT://aMachine/aPrinter") Set pqo = pq If pqo.status = ADS_PRINTER_OFFLINE Then MsgBox pq.Model & "@" & pq.Location & is offline." Else MsgBox pq.Model & "@" & pq.Location & is online." End If
The following C++ code snippet shows how to determine if a specified printer is online or offline.
IADsPrintQueue *pq; HRESULT hr; LPWSTR adsPath = L"WinNT://aMachine/aPrinter"; hr = ADsGetObject(adsPath, IID_IADsPrintQueue, (void**)&pq); if(FAILED(hr)) exit(hr); IADsPrintQueueOperations *pqo; hr = pq->QueryInterface(IID_IADsPrintQueueOperations,(void**)&pqo); if(FAILED(hr)) exit(hr); long status; hr = pqo->get_Status(&status); if(FAILED(hr)) exit(hr); BSTR model,location; hr = pq->get_Model(&model); if(FAILED(hr)) exit(hr); hr =pq->get_Location(&location); if(FAILED(hr)) exit(hr); if(status == ADS_PRINTER_OFFLINE) { printf("%S @ %S is offline.\n",model,location); } else { printf("%S @ %S is online.\n",model,location); } SysFreeString(model); SysFreeString(location); pq->Release(); pqo->Release();