Metodo IPrintReadStreamFactory::GetStream (filterpipeline.h)

Il GetStream metodo ottiene l'interfaccia del flusso.

Sintassi

HRESULT GetStream(
  [out] IPrintReadStream **ppStream
);

Parametri

[out] ppStream

Puntatore a un'interfaccia IPrintReadStream . Il filtro può usare questa interfaccia per leggere il contenuto del ticket di stampa.

Valore restituito

GetStream restituisce un valore HRESULT .

Commenti

Nell'esempio di codice seguente viene illustrato come un filtro può usare IPrintReadStreamFactory per accedere al ticket di stampa per utente.

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

Requisiti

Requisito Valore
Piattaforma di destinazione Desktop
Intestazione filterpipeline.h