ILoadFilter::LoadIFilter method (filtereg.h)

Retrieves and loads the most appropriate filter that is mapped to a Shell data source.

Syntax

HRESULT LoadIFilter(
  [in]      LPCWSTR               pwcsPath,
  [in]      FILTERED_DATA_SOURCES *pFilteredSources,
  [in]      IUnknown              *pUnkOuter,
  [in]      BOOL                  fUseDefault,
  [in, out] CLSID                 *pFilterClsid,
  [in, out] int                   *SearchDecSize,
  [in, out] WCHAR                 **pwcsSearchDesc,
  [in, out] IFilter               **ppIFilt
);

Parameters

[in] pwcsPath

Pointer to a comma-delimited null-terminated Unicode string buffer that specifies the path of the file to be filtered. This parameter can be null.

[in] pFilteredSources

Pointer to the FILTERED_DATA_SOURCES structure that specifies parameters for a Shell data source for which a filter is loaded. This parameter cannot be null.

[in] pUnkOuter

If the object is being created as part of an aggregate, specify a pointer to the controlling IUnknown interface of the aggregate.

[in] fUseDefault

If TRUE, use the default filter; if FALSE, proceed with the most appropriate filter that is available.

[in, out] pFilterClsid

Pointer to the CLSID (CLSID_FilterRegistration) that receives the class identifier of the returned filter.

[in, out] SearchDecSize

Not implemented.

[in, out] pwcsSearchDesc

Not implemented.

[in, out] ppIFilt

The address of a pointer to an implementation of an IFilter interface that LoadIFilter selects.

Return value

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

A filter, also known as a filter handler, is an implementation of the IFilter interface.

ILoadFilter attempts to load a filter that can process a Shell data source of the type specified in the pFilteredSources parameter through the pwcsPath parameter.If an appropriate filter for the data source is not found, and fUseDefault is false, this method returns null in the ppIFilt parameter. If an appropriate filter for the data source is not found, and fUseDefault is true, the IFilter interface on the default IFilter is returned in the ppIFilt parameter.

Requirements

Requirement Value
Minimum supported client Windows 7 [desktop apps only]
Minimum supported server Windows Server 2008 R2 [desktop apps only]
Target Platform Windows
Header filtereg.h
Library SearchSDK.lib (for CLSID_FilterRegistration)

See also

ILoadFilter