LoadIFilterFromStorage Method

The LoadIFilterFromStorage method retrieves the IFilter best suited for the specified Class ID stored in an IStorage object.

Syntax
HRESULT LoadIFilterFromStorage (
IStorage *pStg,
    IUnknown *pUnkOuter,
    WCHARconst * pwcsOverride,
    BOOLfUseDefault,
    CLSID *pFilterClsid,
    Int *SearchDecSize,
    WCHAR **pwcsSearchDesc,
    IFilter **ppIFilt);
Parameters
  • pStg
    [in] A pointer to an IStorage object holding the Class ID of the data source type to be filtered.
  • pUnkOuter
    [in] A pointer to an IUnknown that contains the interface of the calling object.
  • pwcsOverride
    [in] A pointer to a WCHAR that contains an override string.
  • fUseDefault
    [in] A BOOL that specifies that the default filter should be used if a more suitable filter is not found.
  • pFilterClsid
    [out] A pointer to a CLSID that contains the Class ID the returned filter.
  • SearchDecSize
    [in, out] Not used. Value should be 0.
  • pwcsSearchDesc
    [out, size_is(*SearchDecSize)] Not used. Value should be 0.
  • ppIFilt
    [out] An address of a pointer to the IFilter interface of the filter chosen by the method. The value is null if none is found.
Return Value

For a list of errors returned by SharePoint Portal Server IFilter administration objects, see Error Messages.

Remarks

This method attempts to load an IFilter that can process the data source of the type located in pStg.

If the pwcsOverride string is not null, this method searches first for an IFilter that was registered with the override string passed in pwcsOverride. The method then searches for an IFilter among the file types and Class IDs.

If no suitable IFilter is found for the data source, and fUseDefault is false, this method returns null in the ppIFilt parameter. If no suitable IFilter is found for the data source, and fUseDefault is true, the IFilter interface on the default IFilter is returned in the ppIFilt parameter.

The IFilter must be released after it is used.