IPrintReadStreamFactory::GetStream 方法 (filterpipeline.h)
方法 GetStream
會取得數據流介面。
語法
HRESULT GetStream(
[out] IPrintReadStream **ppStream
);
參數
[out] ppStream
IPrintReadStream 介面的指標。 篩選條件可以使用這個介面來讀取列印票證的內容。
傳回值
GetStream
會傳回 HRESULT 值。
備註
下列程式代碼範例示範篩選如何使用 IPrintReadStreamFactory 來存取每個使用者列印票證。
VARIANT var;
VariantInit(&var);
HRESULT hr = pIPropertyBag->GetProperty(
XPS_FP_USER_PRINT_TICKET,
&var);
if (SUCCEEDED(hr))
{
IPrintReadStreamFactory *pPrintReadStreamFactory;
hr = V_UNKNOWN(&var)->QueryInterface(
IID_IPrintReadStreamFactory,
reinterpret_cast<void **>(&pPrintReadStreamFactory));
if (SUCCEEDED(hr))
{
IPrintReadStream *pPrintTicketStream;
hr = pPrintReadStreamFactory->GetStream(&pPrintTicketStream);
if (SUCCEEDED(hr))
{
// Use the print ticket here.
// It's OK to cache the pointer
// to use now and release later.
pPrintTicketStream->Release();
}
pPrintReadStreamFactory->Release();
}
VariantClear(&var);
}
規格需求
需求 | 值 |
---|---|
目標平台 | 桌面 |
標頭 | filterpipeline.h |