There are two ways that file filter errors are returned. First, the NextConvertFile method uses the HRESULT_FROM_WIN32 macro to return an HRESULT error value if the method fails.
But, there is a way to have an error value that is customized to your data type. The NextConvertFile function can return a filter-defined error value in the variable pointed to by the perr parameter. To use this method, the error value must be defined by using the CF_DECLARE_ERROR macro defined in the Replerr.h header file. Also, the filter DLL must include a message table that contains the error value and a corresponding message string. When Windows CE Services gets the filter-defined error value, it then uses the Win32 FormatMessage function to create the error string, using ICeFileFilter::FormatMessage to check the filter object first for the relevant string (). For more information about message tables, see the Microsoft Platform SDK.