IADsPrintQueue 属性方法

IADsPrintQueue 接口的属性方法获取或设置下表中所述的属性。 有关详细信息,请参阅 Interface 属性方法

属性

BannerPage

指向用于分隔打印作业的横幅页面的文件系统路径。 如果 为 NULL,则不使用横幅页。

访问类型:读/写

脚本数据类型: BSTR

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

数据类型

此队列可以处理的数据类型。

访问类型:读/写

脚本数据类型: BSTR

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

DefaultJobPriority

分配给每个打印作业的默认优先级。

访问类型:读/写

脚本数据类型: BSTR

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

描述

此打印队列的文本说明。

访问类型:读/写

脚本数据类型: BSTR

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

HostComputer

引用主计算机的 ADsPath 字符串。

访问类型:读/写

脚本数据类型: BSTR

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

位置

管理员描述的队列位置。

访问类型:读/写

脚本数据类型: BSTR

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

型号

此打印队列使用的驱动程序的名称。

访问类型:读/写

脚本数据类型: BSTR

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

PrintDevices

BSTRSAFEARRAY,包含此打印队列后台处理程序作业的打印设备的名称。

访问类型:读/写

脚本数据类型: VARIANT

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

PrinterPath

引用可访问共享打印机的路径的字符串。

访问类型:读/写

脚本数据类型: BSTR

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

PrintProcessor

与此队列关联的打印处理器。

访问类型:读/写

脚本数据类型: BSTR

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

优先级

任何连接的设备的此打印机对象作业队列的优先级。 将首先处理优先级较高的打印队列对象中的所有作业。

访问类型:读/写

脚本数据类型: LONG

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

StartTime

队列应开始处理作业的时间。 将忽略时间的日期部分。

访问类型:读/写

脚本数据类型: DATE

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

UntilTime

队列应停止处理作业的时间。

访问类型:读/写

脚本数据类型: DATE

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

示例

下面的代码示例演示如何确定指定的打印机是联机还是脱机。

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

下面的代码示例演示如何确定指定的打印机是联机还是脱机。

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();

要求

要求
最低受支持的客户端
Windows Vista
最低受支持的服务器
Windows Server 2008
标头
Iads.h
DLL
Activeds.dll
IID
IID_IADsPrintQueue定义为 B15160D0-1226-11CF-A985-00AA006BC149

另请参阅

IADsPrintQueue

Interface 属性方法