Bewerken

Delen via


GetSupportedVersions

Important

The modern print platform is Windows' preferred means of communicating with printers. We recommend that you use Microsoft's IPP inbox class driver, along with Print Support Apps (PSA), to customize the print experience in Windows 10 and 11 for printer device development.

For more information, see Modern print platform and the Print support app design guide.

The IPrintTicketProvider::GetSupportedVersions method returns the major version numbers of the Print Schemas that print driver supports. For now, version 1 is the only version that exists so this method must return only one supported version.

The implementation shown in the following sample code will work for the initial version of Windows Vista and until a new version is added. When a new version is supported, this value will change.

STDMETHODIMP 
CPrintTicketProvider::
GetSupportedVersions(THIS_ HANDLE hPrinter,
                           INT *ppVersions[],
                           INT *pcVersions)
{
    if ( (*ppVersions = (INT*)CoTaskMemAlloc(sizeof(INT))) != NULL)
    {
         (*ppVersions)[0] = 1;  // Version 1
        *pcVersions = 1; // 1 supported version
        return S_OK;
    }
    else
        return E_OUTOFMEMORY;
}