IProtocolHandlerSite::GetFilter method (searchapi.h)
Retrieves the appropriate IFilter according to the supplied parameters.
Syntax
HRESULT GetFilter(
[in] CLSID *pclsidObj,
[in] LPCWSTR pcwszContentType,
[in] LPCWSTR pcwszExtension,
[out] IFilter **ppFilter
);
Parameters
[in] pclsidObj
Type: CLSID*
Pointer to the CLSID of the document type from the registry. This is used for items with embedded documents to indicate the appropriate IFilter to use for that embedded document.
[in] pcwszContentType
Type: LPCWSTR
Pointer to a null-terminated Unicode string that contains the type of the document. This is used to retrieve IFilters that are mapped according to MIME type.
[in] pcwszExtension
Type: LPCWSTR
Pointer to a null-terminated Unicode string that contains the file name extension, without the preceding period. This is used to retrieve IFilter objects that are mapped according to the file name extension.
[out] ppFilter
Type: IFilter**
Receives the address of a pointer to the IFilter that the protocol handler uses.
Return value
Type: HRESULT
If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
Remarks
This method queries the Filter Host to identify the appropriate IFilter object to use for the URL item.
The choice of filter is based on the file name extension, a CLSID that identifies the file's content type in the registry, or on the MIME content type. You need to provide only one of the three parameters to this method. If you provide multiple parameters, they are tested in the following order: pcwszContentType, pclsidObj, pcwszExtension. The first valid parameter is used to select the appropriate IFilter; the others are ignored.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows XP with SP2, Windows Vista [desktop apps only] |
Minimum supported server | Windows Server 2003 with SP1 [desktop apps only] |
Target Platform | Windows |
Header | searchapi.h |
Redistributable | Windows Desktop Search (WDS) 3.0 |