IPrintReadStreamFactory::GetStream method

The GetStream method gets the stream interface.

Syntax

HRESULT GetStream(
  IPrintReadStream **ppStream
);

Parameters

ppStream

A pointer to an IPrintReadStream interface. The filter can use this interface to read the contents of the print ticket.

Return Value

GetStream returns an HRESULT value.

Remarks

The following code example shows how a filter can use IPrintReadStreamFactory to access the per-user print ticket.

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

Requirements

   
Target Platform Desktop
Header filterpipeline.h