PTOpenProviderEx function (prntvpt.h)
Opens an instance of a print ticket provider.
Syntax
HRESULT PTOpenProviderEx(
[in] PCWSTR pszPrinterName,
DWORD dwMaxVersion,
DWORD dwPrefVersion,
[out] HPTPROVIDER *phProvider,
[out] DWORD *pUsedVersion
);
Parameters
[in] pszPrinterName
A pointer to the full name of a print queue.
dwMaxVersion
The latest version of the Print Schema that the caller supports.
dwPrefVersion
The version of the Print Schema requested by the caller.
[out] phProvider
A pointer to a handle for the provider.
[out] pUsedVersion
A pointer to the version of the Print Schema that the print ticket provider will use.
Return value
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.
Remarks
The first version of the Print Schema was released with Windows Vista and is version 1. If the print ticket provider does not support prefVersion, PTOpenProviderEx successfully opens a handle and returns an earlier version in usedVersion.
To avoid a resource leak, phProvider must be closed with PTCloseProvider.
Requirements
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 |