Condividi tramite


Metodo IPrintReadStreamFactory::GetStream (filterpipeline.h)

Il metodo GetStream ottiene l'interfaccia del flusso.

Sintassi

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

Parametri

[out] ppStream

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

Valore restituito

GetStream restituisce un valore di HRESULT.

Osservazioni

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

Fabbisogno

Requisito Valore
piattaforma di destinazione Desktop
intestazione filterpipeline.h