Initializes a handler with a file path.
- pszFilePath [in]
A pointer to a buffer that contains the file path as a null-terminated Unicode string.
- grfMode [in]
One of the following STGM values that indicates the access mode for pszFilePath.
If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
Initialize is preferred to this method because of its ability to use files that are not accessible through a Win32 path, such as the contents of a compressed file with a .zip file name extension. Use IInitializeWithFile::Initialize only when the API used by the handler to access the file accepts file paths only.
The file pointed to by pszFilePath must remain open for the lifetime of the handler or until IPropertyStore::Commit is called.
If the file cannot be opened according to the method's parameter values, this method returns a suitable error code.
A handler instance should be initialized only once in its lifetime. Attempts by the calling application to reinitialize the handler should result in the error
Minimum supported client
|Windows Vista [desktop apps only]|
Minimum supported server
|Windows Server 2008 [desktop apps only]|