IVsFormatFilterProvider.CurFileExtensionFormat(String, UInt32) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Provides the index in the filter list that matches the extension of the file passed in.
public:
int CurFileExtensionFormat(System::String ^ bstrFileName, [Runtime::InteropServices::Out] System::UInt32 % pdwExtnIndex);
int CurFileExtensionFormat(std::wstring const & bstrFileName, [Runtime::InteropServices::Out] unsigned int & pdwExtnIndex);
public int CurFileExtensionFormat (string bstrFileName, out uint pdwExtnIndex);
abstract member CurFileExtensionFormat : string * uint32 -> int
Public Function CurFileExtensionFormat (bstrFileName As String, ByRef pdwExtnIndex As UInteger) As Integer
Parameters
- bstrFileName
- String
[in] Filename and extension of interest.
- pdwExtnIndex
- UInt32
[out] Index in the FormatFilterList (the pbstrFilterList
parameter of GetFormatFilterList).
Returns
If the method succeeds, it returns S_OK. If it fails, it returns an error code.
Remarks
COM Signature
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.