Partager via


IPersistFileFormat.Load Method

Opens a specified file and initializes an object from the file contents.

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

Syntax

'Declaration
Function Load ( _
    pszFilename As String, _
    grfMode As UInteger, _
    fReadOnly As Integer _
) As Integer
int Load(
    string pszFilename,
    uint grfMode,
    int fReadOnly
)
int Load(
    [InAttribute] String^ pszFilename, 
    [InAttribute] unsigned int grfMode, 
    [InAttribute] int fReadOnly
)
abstract Load : 
        pszFilename:string * 
        grfMode:uint32 * 
        fReadOnly:int -> int
function Load(
    pszFilename : String, 
    grfMode : uint, 
    fReadOnly : int
) : int

Parameters

  • pszFilename
    Type: String

    [in] Pointer to the name of the file to load, which, for an existing file, should always include the full path.

  • grfMode
    Type: UInt32

    [in] File format mode. If zero, the object uses the usual defaults as if the user had opened the file.

  • fReadOnly
    Type: Int32

    [in] true indicates that the file should be opened as read-only.

Return Value

Type: 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::Load(
   [in] LPCOLESTR pszFilename,
   [in] DWORD grfMode,
   [in] BOOL fReadOnly
);

The IPersistFileFormat.Load method can return STG_E_INVALIDCODEPAGE or STG_S_DATALOSS.

.NET Framework Security

See Also

Reference

IPersistFileFormat Interface

Microsoft.VisualStudio.Shell.Interop Namespace