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
声明
Function Load ( _
pszFilename As String, _
grfMode As UInteger, _
fReadOnly As Integer _
) As Integer
用法
Dim instance As IPersistFileFormat
Dim pszFilename As String
Dim grfMode As UInteger
Dim fReadOnly As Integer
Dim returnValue As Integer
returnValue = instance.Load(pszFilename, _
grfMode, fReadOnly)
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: 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.
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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.