Поделиться через


IPersistFileFormat.GetFormatList Method

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.

Namespace:  Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)

Syntax

'Declaration
Function GetFormatList ( _
    <OutAttribute> ByRef ppszFormatList As String _
) As Integer
int GetFormatList(
    out string ppszFormatList
)
int GetFormatList(
    [OutAttribute] String^% ppszFormatList
)
abstract GetFormatList : 
        ppszFormatList:string byref -> int 
function GetFormatList(
    ppszFormatList : String
) : int

Parameters

  • ppszFormatList
    Type: System.String%
    [out] Pointer to a string that contains pairs of format filter strings.

Return Value

Type: System.Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

COM Signature

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 nulla null reference (Nothing in Visual Basic) (\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."

.NET Framework Security

See Also

Reference

IPersistFileFormat Interface

Microsoft.VisualStudio.Shell.Interop Namespace