IVsFormatFilterProvider::CurFileExtensionFormat Method (String^, UInt32)
Provides the index in the filter list that matches the extension of the file passed in.
Assembly: Microsoft.VisualStudio.TextManager.Interop (in Microsoft.VisualStudio.TextManager.Interop.dll)
int CurFileExtensionFormat( String^ bstrFileName, [OutAttribute] unsigned int% pdwExtnIndex )
Parameters
- bstrFileName
-
Type:
System::String^
[in] Filename and extension of interest.
- pdwExtnIndex
-
Type:
System::UInt32
[out] Index in the FormatFilterList (the pbstrFilterList parameter of GetFormatFilterList).
Return Value
Type: System::Int32If the method succeeds, it returns S_OK. If it fails, it returns an error code.
From textmgr.idl:
HRESULT IVsFormatFilterProvider::CurFileExtensionFormat(
[in]BSTR bstrFileName,
[out] DWORD *pdwExtnIndex
);
The index returned in pdwExtnIndex is determined by the place in the FormatFilterList, which is the pbstrFilterList parameter of GetFormatFilterList of the filter matching the extension of the file inbstrFileName. For example, if ".*" was passed into the default filter (see GetFormatFilterList), 0 would be stored in pdwExtnIndex. Likewise a 1 would be stored for a ".txt" passed in. You should only be concerned with your file extensions and not the All Files or Text Files. If the file extension in bstrFileName doesn't match one that you support, return E_FAIL.