GetOptions

IPrintCoreUI2::GetOptions method

The IPrintCoreUI2::GetOptions method retrieves the driver's current feature settings in the format of a list of feature/option keyword pairs.

Syntax


HRESULT GetOptions(
  [in]  POEMUIOBJ poemuiobj,
  [in]  DWORD     dwFlags,
  [in]  PCSTR     pmszFeaturesRequested,
  [in]  DWORD     cbIn,
  [out] PSTR      pmszFeatureOptionBuf,
  [in]  DWORD     cbSize,
  [out] PDWORD    pcbNeeded
);

Parameters

poemuiobj [in]

Pointer to the current context, an OEMUIOBJ structure.

dwFlags [in]

Is reserved and must be set to zero.

pmszFeaturesRequested [in]

Pointer to caller-supplied buffer containing a list of feature keywords (in MULTI_SZ format) whose settings are requested. Set this parameter to NULL to obtain settings for all features.

cbIn [in]

Specifies the size, in bytes, of the buffer pointed to by pmszFeaturesRequested. The size includes the last MULTI_SZ null character.

pmszFeatureOptionBuf [out]

Pointer to a caller-supplied buffer that receives a list of feature/option keyword pairs (in MULTI_SZ format) obtained from the driver settings. Each feature/option keyword pair contains the feature keyword name, a null character, the option keyword name, and another null character. The list is terminated by two null characters.

cbSize [in]

Specifies the size, in bytes, of the buffer pointed to by pmszFeatureOptionBuf.

pcbNeeded [out]

Pointer to a memory location that receives the actual size, in bytes, of the feature/option keyword pairs.

Return value

The method must return one of the following values.

Return codeDescription
S_OK

The method succeeded.

E_OUTOFMEMORY

The value in cbSize was smaller than the number of bytes to be written to the output buffer (the buffer pointed to by pmszFeatureOptionBuf).

The method was called with pmszFeatureOptionBuf set to NULL.

E_INVALIDARG

The input buffer (the buffer pointed to by pmszFeaturesRequested) was provided, but its contents were not in MULTI_SZ format.

The poemuiobj parameter pointed to an invalid context object.

E_NOTIMPL

The method is not supported.

E_FAIL

The method failed

 

Remarks

This method is supported only for Windows XP Pscript5 UI plug-ins that fully replace the core driver's standard UI pages, and is supported only during the UI plug-in's IPrintOemUI::DocumentPropertySheets and IPrintOemUI::DevicePropertySheets functions, and their property sheet callback routines. See Replacing Driver-Supplied Property Sheet Pages for more information.

If a requested feature keyword is not recognized, or recognized but not supported in the current sticky mode (document-sticky or printer-sticky -- see Replacing Driver-Supplied Property Sheet Pages), or the feature keyword is recognized but there is currently no option selection for it, the feature is simply ignored and the feature/option keyword pair is not placed in the output buffer.

To reduce the need to make two calls per data access, pass the method an output buffer of a fixed size (1 KB, for example), and then check the function return value. If the method returns S_OK, the buffer already contains the data of interest. If the method returns E_OUTOFMEMORY, the value in *pcbNeeded is the buffer size needed to hold the data of interest. The caller should then allocate a buffer of that larger size and proceed with a second call to the method.

For more information, see Using GetOptions and SetOptions.

Requirements

Target platform

Header

Prcomoem.h (include Prcomoem.h)

See also

OEMUIOBJ
IPrintOemUI::DocumentPropertySheets
IPrintOemUI::DevicePropertySheets
IPrintCoreUI2::SetOptions

 

 

Send comments about this topic to Microsoft

Show:
© 2016 Microsoft