Share via


IUrlAccessor::GetDocFormat Method

Gets the document format, represented as a Multipurpose Internet Mail Extensions (MIME) string.

Syntax

HRESULT GetDocFormat(      
    WCHAR wszDocFormat[],
    DWORD dwSize,
    DWORD *pdwLength
);

Parameters

  • wszDocFormat
    [out]  Receives a pointer to a null-terminated Unicode string containing the MIME type for the current item.
  • dwSize
    [in]  Size of wszDocFormat in TCHARs.
  • pdwLength
    [out]  Receives a pointer to the number of TCHARs written to wszDocFormat, not including the terminating NULL.

Return Value

Returns S_OK if successful, or an error value otherwise.

Remarks

The wszDocFormat is used to identify the correct IFilter for the stream returned by IUrlAccessor::BindToStream. Implement this method when the URL item is supposed to have a different association than is indicated by the file extension or content type. For example, if .doc items are not associated with Microsoft Word, this method should return the CLSID Key key of the appropriate document source.

If you do not provide an implementation of this method or the IUrlAccessor::GetCLSID method, the filter host uses the out parameters from IUrlAccessor::GetFileName to determine the Multipurpose Internet Mail Extensions (MIME) content type.