IPersistFileFormat::GetFormatList Method (String^)
Provides the caller with the information necessary to open the standard common Save As dialog box (using the GetSaveFileNameViaDlg function) on behalf of the object.
Assembly: Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)
Parameters
- ppszFormatList
-
Type:
System::String^
[out] Pointer to a string that contains pairs of format filter strings.
Return Value
Type: System::Int32If the method succeeds, it returns S_OK. If it fails, it returns an error code.
From fpstfmt.idl:
HRESULT IPersistFileFormat::GetFormatList( [out] LPOLESTR *ppszFormatList );
GetFormatList returns an enumeration of supported formats, from which the caller selects the appropriate format. The selection is then passed back to the Save method.
Each string should be terminated with a newline (\n) character. The last string in the buffer must be terminated with the newline character as well. The caller can replace each newline character with a null (\0) character. Then, the caller can have a string that is the same as the lpstrFilter member of the WinAPI VSOPENFILENAMEW structure. The first string in each pair is a display string that describes the filter, such as "Text Only (*.txt)". The second string specifies the filter pattern, such as "*.txt". To specify multiple filter patterns for a single display string, use a semicolon to separate the patterns: "*.htm;*.html;*.asp". A pattern string can be a combination of valid file name characters and the asterisk (*) wildcard character. Do not include spaces in the pattern string. The following string is an example of a file pattern string: "HTML File (*.htm; *.html; *.asp)\n*.htm;*.html;*.asp\nText File (*.txt)\n*.txt\n."