Platform SDK: Active Directory, ADSI, and Directory Services

IADsPrintQueueOperations Property Methods

The property methods of the IADsPrintQueueOperations interface read and write the properties described in the following table. For a general discussion of property methods, see Interface Property Methods.

Properties in Vtable Order

Property Description
Status

[Visual Basic]
Access: Read
Data Type: LONG

[C++]
HRESULT get_Name
(
[out] LONG *pbstrName);

HRESULT put_Name
(
[in] LONG bstrName);

Current status of the print queue operations. The valid status code values are listed in the following list.
  Status
ADS_PRINTER_PAUSED
ADS_PRINTER_PENDING_DELETION
ADS_PRINTER_ERROR
ADS_PRINTER_PAPER_JAM
ADS_PRINTER_PAPER_OUT
ADS_PRINTER_MANUAL_FEED
ADS_PRINTER_PAPER_PROBLEM
ADS_PRINTER_OFFLINE
ADS_PRINTER_IO_ACTIVE
ADS_PRINTER_BUSY
ADS_PRINTER_PRINTING
ADS_PRINTER_OUTPUT_BIN_FULL
ADS_PRINTER_NOT_AVAILABLE
ADS_PRINTER_WAITING
ADS_PRINTER_PROCESSING
ADS_PRINTER_INITIALIZING
ADS_PRINTER_WARMING_UP
ADS_PRINTER_TONER_LOW
ADS_PRINTER_NO_TONER
ADS_PRINTER_PAGE_PUNT
ADS_PRINTER_USER_INTERVENTION
ADS_PRINTER_OUT_OF_MEMORY
ADS_PRINTER_DOOR_OPEN
ADS_PRINTER_SERVER_UNKNOWN
ADS_PRINTER_POWER_SAVE
Hex Value
0x00000001
0x00000002
0x00000003
0x00000004
0x00000005
0x00000006
0x00000007
0x00000008
0x00000100
0x00000200
0x00000400
0x00000800
0x00001000
0x00002000
0x00004000
0x00008000
0x00010000
0x00020000
0x00040000
0x00080000
0x00100000
0x00200000
0x00400000
0x00800000
0x01000000

Code Example [Visual Basic]

The following Visual Basic code snippet checks if a printer is jammed.

Dim pqo As IADsPrintQueueOperations
Set pqo = GetObject("WinNT://aMachine/aPrinter")
If pqo.Status = ADS_PRINTER_PAPER_JAM Then
MsgBox "Your printer is jammed."
End If

Example Code [C++]

The following C++ code snippet checks if a printer is jammed.

IADsPrintQueueOperations *pqo;
HRESULT hr = ADsGetObject(L"WinNT://aMachine/aPrinter",
IID_IADsPrintQueueOperations,
(void**)&pqo)
long status;
hr = pqo->get_Status(&status);
if(status = ADS_PRINTER_PAPER_JAM) {
printf("Your printer is jammed.\n");
}
hr = pqo->Release();

See Also

IADsPrintQueue, IADsPrintQueueOperations