Directory Services

IADsPrintQueue Property Methods

The property methods of the IADsPrintQueue interface get or set the properties described in the following table. For more information, see Interface Property Methods.

Properties

Property Description
BannerPage

[Visual Basic]
Access: Read/Write
DataType: BSTR

[C++]
HRESULT get_BannerPage
([out] BSTR* pbstrBannerPage);
HRESULT put_BannerPage
([in] BSTR bstrBannerPage);

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]
Access: Read/Write
DataType: BSTR

[C++]
HRESULT get_Datatype
([out] BSTR* pbstrDatatype);
HRESULT put_Datatype
([in] BSTR bstrDatatype);

The data type that can be processed by this queue.
DefaultJobPriority

[Visual Basic]
Access: Read/Write
DataType: Long

[C++]
HRESULT get_DefaultJobPriority
([out] LONG* plDefaultJobPriority);
HRESULT put_DefaultJobPriority
([in] BSTR lDefaultJobPriority);

The default priority assigned to each print job.
Description

[Visual Basic]
Access: Read/Write
DataType: BSTR

[C++]
HRESULT get_Description
([out] BSTR* pbstrDescription);
HRESULT put_Description
([in] BSTR bstrDescription);

The text description of this print queue.
HostComputer

[Visual Basic]
Access: Read/Write
DataType: BSTR

[C++]
HRESULT get_HostComputer
([out] BSTR* pbstrHostComputer);
HRESULT put_HostComputer
([in] BSTR bstrHostComputer);

The ADsPath string that references the host computer.
Location

[Visual Basic]
Access: Read/Write
DataType: BSTR

[C++]
HRESULT get_Location
([out] BSTR* pbstrLocation);
HRESULT put_Location
([in] BSTR bstrLocation);

The location of the queue as described by an administrator.
Model

[Visual Basic]
Access: Read/Write
DataType: BSTR

[C++]
HRESULT get_Model
([out] BSTR* pbstrModel);
HRESULT put_Model
([in] BSTR bstrModel);

The name of the driver used by this print queue.
PrintDevices

[Visual Basic]
Access: Read/Write
DataType: Variant

[C++]
HRESULT get_PrintDevices
([out] VARIANT* pvPrintDevices);
HRESULT put_PrintDevices
([in] VARIANT vPrintDevices);

A SAFEARRAY of BSTR that contains the names of the print devices to which this print queue spools jobs.
PrinterPath

[Visual Basic]
Access: Read/Write
DataType: BSTR

[C++]
HRESULT get_PrinterPath
([out] BSTR* pbstrPrinterPath);
HRESULT put_PrinterPath
([in] BSTR bstrPrinterPath);

The string that references the path by which a shared printer can be accessed.
PrintProcessor

[Visual Basic]
Access: Read/Write
DataType: BSTR

[C++]
HRESULT get_PrintProcessor
([out] BSTR* pbstrPrintProcessor);
HRESULT put_PrintProcessor
([in] BSTR bstrPrintProcessor);

The print processor associated with this queue.
Priority

[Visual Basic]
Access: Read/Write
DataType: Long

[C++]
HRESULT get_Priority
([out] LONG* plPriority);
HRESULT put_Priority
([in] LONG lPriority);

The priority of this printer object job queue for any connected devices. All jobs in higher priority print queue objects will be processed first.
StartTime

[Visual Basic]
Access: Read/Write
DataType: Date

[C++]
HRESULT get_StartTime
([out] DATE* pdateStartTime);
HRESULT put_StartTime
([in] DATE dateStartTime);

The time when the queue should begin processing jobs. The date portion of the time is ignored.
UntilTime

[Visual Basic]
Access: Read/Write
DataType: Date

[C++]
HRESULT get_UntilTime
([out] DATE* pdateUntilTime);
HRESULT put_UntilTime
([in] DATE dateUntilTime);

The time when the queue should stop processing jobs.

Example Code [Visual Basic]

The following code example shows how to determine if a specified printer is online or offline.

Dim pq As IADsPrintQueue
Dim pqo As IADsPrintQueueOperations
On Error GoTo Cleanup
 
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

Cleanup:
	If (Err.Number<>0) Then
		MsgBox("An error has occurred. " & Err.Number)
	End If
	Set pq = Nothing
	Set pqo = Nothing

Example Code [C++]

The following code example shows how to determine if a specified printer is online or offline.

IADsPrintQueue *pq = NULL;
HRESULT hr = S_OK;
IADsPrintQueueOperations *pqo = NULL;
BSTR model = NULL;
BSTR location = NULL;

LPWSTR adsPath = L"WinNT://aMachine/aPrinter";
hr = ADsGetObject(adsPath,
				IID_IADsPrintQueue,
				(void**)&pq);
if(FAILED(hr)) {goto Cleanup;}


hr = pq->QueryInterface(IID_IADsPrintQueueOperations,(void**)&pqo);
if(FAILED(hr)) {goto Cleanup;}

long status;
hr = pqo->get_Status(&status);
if(FAILED(hr)) {goto Cleanup;}

hr = pq->get_Model(&model);
if(FAILED(hr)) {goto Cleanup;}

hr =pq->get_Location(&location);
if(FAILED(hr)) {goto Cleanup;}

if(status == ADS_PRINTER_OFFLINE) 
{
	printf("%S @ %S is offline.\n",model,location);
} 
else 
{
	printf("%S @ %S is online.\n",model,location);
}


Cleanup:
	SysFreeString(model);
	SysFreeString(location);
	if(pq) pq->Release();
	if(pqo) pqo->Release();

Requirements

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.

See Also

IADsPrintQueue, Interface Property Methods