IPersistFileFormat::Load Method (String^, UInt32, Int32)

 

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)

int Load(
	String^ pszFilename,
	unsigned int grfMode,
	int fReadOnly
)

Parameters

pszFilename
Type: System::String^

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

grfMode
Type: System::UInt32

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

fReadOnly
Type: System::Int32

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

Return Value

Type: System::Int32

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

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.

Return to top
Show: