![]() When the calling client application or service provider is finished with the IStream object, it should free it by calling the OLE IStream::Release method. For this usage, the lpszFileName parameter can optionally designate the path to the directory where the file is to be created, and the lpszPrefix parameter can optionally specify a prefix for the filename. When SOF_UNIQUEFILENAME is set, OpenStreamOnFile creates a temporary file to hold data for an IStream object. In this case the lpszFileName parameter specifies the path and filename of the file. When this flag is not set, OpenStreamOnFile opens an IStream object on an existing file, for example to copy its contents to the PR_ATTACH_DATA_BIN ( PidTagAttachDataBinary) property of an attachment using the IStream::CopyTo method. The OpenStreamOnFile function has two important uses, distinguished by the setting of the SOF_UNIQUEFILENAME flag. The file could not be accessed due to insufficient user permissions or because read-only files cannot be modified. The call succeeded and has returned the expected value or values. Pointer to a pointer to an object exposing the IStream interface. ![]() If lpszPrefix is NULL, a prefix of "SOF" is used. If set, the prefix must contain not more than three characters. The prefix for the filename on which OpenStreamOnFile initializes the IStream object. If lpszFileName is NULL, OpenStreamOnFile obtains an appropriate path from the system, and both the STGM_CREATE and STGM_DELETEONRELEASE flags must be set. If the SOF_UNIQUEFILENAME flag is set, lpszFileName contains the path to the directory in which to create a temporary file. The filename, including path and extension, of the file for which OpenStreamOnFile initializes the IStream object. If this flag is not set, the STGM_CREATE flag must not be set either. The file is to be created or opened with read/write permission. The file is to be created or opened with read-only access. If the lpszFileName parameter is not set, both this flag and STGM_CREATE must be set. The file is to be deleted when the IStream object is released. If STGM_CREATE is set, the STGM_READWRITE flag must also be set. If the lpszFileName parameter is not set, both this flag and STGM_DELETEONRELEASE must be set. The file is to be created even if one already exists. ![]() If this flag is set, the STGM_CREATE and STGM_READWRITE flags should also be set. The following flags can be set:Ī temporary file is to be created for the IStream object. Bitmask of flags used to control the creation or opening of the file to be accessed through the OLE IStream object. Pointer to the MAPIFreeBuffer function, to be used to free memory. Pointer to the MAPIAllocateBuffer function, to be used to allocate memory. HRESULT STDMETHODCALLTYPE OpenStreamOnFile( ItemĬlient applications and service providers This function takes an ANSI string as the file name including the path and the file extension, therefore, use of the Unicode version of this function, OpenStreamOnFileW, is recommended. Allocates and initializes an OLE IStream object to access the contents of a file.
0 Comments
Leave a Reply. |