Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This method is called by the Internet browser when the user selects a conversion type from the browser conversion selection dialog box.

Syntax

STDMETHODIMP IPegasusFileFilter::NextConvertFile(
  int 
nConversion,
  PFF_CONVERTINFO* 
pci,
  PFF_SOURCEFILE* 
psf,
  PFF_DESTINATIONFILE* 
pdf,
  volatile BOOL* 
pbCancel,
  PR_ERROR* 
perr
);

Parameters

nConversion

[in] Counter for converting a single source file into multiple destination files. This parameter is zero the first time NextConvertFileis called and is incremented for each successive call. A simple filter should return HRESULT_FROM_WIN32 (ERROR_NO_MORE_ITEMS )if this parameter is not zero.

pci

[in] Pointer to a PFF_CONVERTINFOstructure that contains a pointer to an IPegasusFileFilterSiteobject. A file filter uses this interface to create an IStreamor IStorageobject to read the contents of the source file or to write to the destination file. The type of interface object to create is determined by the nHowToOpenparameter in the IPegasusFileFilterSite::OpenSourceFileand IPegasusFileFilterSite::OpenDestinationFilemethods. Any files opened in this way should be closed using the corresponding IPegasusFileFilterSite::CloseSourceFileor IPegasusFileFilterSite::CloseDestinationFilemethod.

psf

[in] Pointer to a PFF_SOURCEFILEstructure that contains information about the source file.

pdf

[in] Pointer to a PFF_DESTINATIONFILEstructure that contains information about the destination file.

pbCancel

[in] Pointer to a Boolean value that is set TRUE if the user cancels the file conversion before it is completed, or FALSE otherwise. Because this variable is updated asynchronously by another thread, its contents can change at any time. A file filter must check this variable regularly during the conversion process, and return ERROR_CANCELLED (after cleaning up) if it is ever set TRUE.

perr

[out] Pointer to a filter-defined error value that can be passed by the mobile Internet browser to the IPegasusFileFilter::FormatMessagemethod. This error value is ignored unless the return value from NextConvertFileis E_FAIL.

Return Value

The following table shows the possible return values for this method.

Value Description

NOERROR

Subconversion successful. Proceed to next subconversion.

HRESULT_FROM_WIN32 (ERROR_CANCELLED)

The user canceled the conversion.

HRESULT_FROM_WIN32 (ERROR_NO_MORE_ITEMS)

The conversion, or last subconversion, was successful. End calls to IPegasusFileFilter::NextConvertFile.

E_FAIL

The perrparameter contained an error value that should be passed to IPegasusFileFilter::FormatMessage.

Remarks

The mobile Internet browser next calls NextConvertFilerepeatedly, incrementing the nConversionparameter, until the return value is ERROR_NO_MORE_ITEMS. A simple filter should return NOERROR the first time this method is called, and thereafter return HRESULT_FROM_WIN32(ERROR_NO_MORE_ITEMS ). Alternatively, a file filter can return E_FAIL and specify a filter-defined error code in the variable pointed to by perr.

As a file conversion progresses, a file filter should periodically call IPegasusFileFilterSite::ReportProgressto report its progress. The browser uses the progress information to update a progress bar that shows the user how much of the conversion is complete.

If any important data is intentionally discarded by a file filter during the conversion process, the filter should call IPegasusFileFilterSite::ReportLossto report the loss. When calling this ReportLoss, the filter specifies a message that explains the data loss, and the mobile Internet browser formats and displays the message in a message box when the file conversion has completed.

Requirements

Header replfilt.h
Library coredll.lib
Windows Embedded CE Windows CE 1.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also