PTOpenProvider function (prntvpt.h)
Opens an instance of a print ticket provider.
HRESULT PTOpenProvider(
[in] PCWSTR pszPrinterName,
DWORD dwVersion,
[out] HPTPROVIDER *phProvider
);
[in] pszPrinterName
A pointer to the full name of a print queue.
dwVersion
The version of the Print Schema requested by the caller.
[out] phProvider
A pointer to a handle for the provider.
If the operation succeeds, the return value is S_OK, otherwise the HRESULT contains an error code.
For more information about COM error codes, see Error Handling.
The first version of the Print Schema was released with Windows Vista and is version 1. This operation fails if version is not supported. Contrast this with PTOpenProviderEx which opens a provider even if it supports only versions that are earlier than requested.
To avoid a resource leak, phProvider must be closed with PTCloseProvider.
Requirement | Value |
---|---|
Minimum supported client | Windows XP [desktop apps only] |
Minimum supported server | Windows Server 2003 [desktop apps only] |
Target Platform | Windows |
Header | prntvpt.h |
Library | Prntvpt.lib |
DLL | Prntvpt.dll |