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