|
StgOpenStorageOnILockBytes
Opens an existing storage object that does not reside in a disk file, but
instead has an underlying byte array provided by the caller.
HRESULT StgOpenStorageOnILockBytes(
ILockBytes * plkbyt,
| //Specifies the underlying byte array
| IStorage * pStgPriority,
| //Points to a previous opening of a root storage object
| DWORD grfMode,
| //Specifies the access mode for the object
| SNB snbExclude,
| //Points to an SNB structure specifying elements to be excluded
| DWORD reserved,
| //Reserved, must be zero
| IStorage ** ppstgOpen
| //Points to location for returning the storage object
| );
|
|
Parameters
plkbyt
Points to the underlying byte array that contains the storage object to be
opened.
pStgPriority
Most often NULL. If not NULL, this parameter is used instead of the plkbyt parameter to specify the storage object to open. It points to a previous
opening of a root storage object, most often one that was opened in priority mode.
After the StgOpenStorageOnILockBytes function returns, the storage object specified in the pStgPriority parameter on function entry is invalid, and can no longer be used; use the
one specified in the ppStgOpen parameter instead.
grfMode
Specifies the access mode to use to open the storage object.
snbExclude
May be NULL. If not NULL, this parameter points to a block of elements in this
storage that are to be excluded as the storage object is opened. This
exclusion occurs independent of whether a snapshot copy happens on the open. .
reserved
Indicates reserved for future use; must be zero.
ppstgOpen
Points to the location where the opened storage is placed.
Return Values
S_OK
Indicates the storage object was successfully opened.
STG_E_FILENOTFOUND
Indicates the specified byte array does not exist.
STG_E_ACCESSDENIED
Indicates insufficient access to open the byte array. Exclusions specified
without read-write permissions or attempt to open the byte array with conflicting
permissions to a simultaneous open.
STG_E_FILEALREADYEXISTS
Indicates the byte array exists but is not a storage object.
STG_E_TOOMANYOPENFILES
Indicates the storage object was not opened because there are too many open
files.
STG_E_INSUFFICIENTMEMORY
Indicates the storage object was not opened due to a lack of memory.
STG_E_INVALIDNAME
Indicates bad name in the pwcsName parameter or the snbExclude parameter.
STG_E_INVALIDPOINTER
Indicates bad pointer in one of the parameters: snbExclude, pwcsName, pstgPriority, or ppStgOpen.
STG_E_INVALIDFLAG
Indicates bad flag combination in the grfMode parameter.
STG_E_INVALIDFUNCTION
Indicates STGM_DELETEONRELEASE specified in the grfMode parameter.
STG_E_OLDDLL
Indicates the DLL being used to open this storage object is a version prior to
the one used to create it.
STG_E_OLDFORMAT
Indicates the storage object being opened was created by the Beta 1 storage
provider. This format is no longer supported.
File system error return values.
ILockBytes interface error return values.
Comments
This function opens the specified root storage object. The storage object is
opened according to the access mode in the grfMode parameter; a pointer to the opened storage object is returned through the ppstgOpen parameter.
The storage object must have been previously created by the StgCreateDocfileOnILockBytes function.
The semantics of the StgOpenStorageOnILockBytes function are almost exactly the same as those of the StgOpenStorage function. For more information, see the discussion of the StgOpenStorage function.
See Also
StgOpenStorage
| Last news from Greatis Software |
 |
|
Nostalgia .Net |
|
.Net is powerful, but not all-powerful, so sometimes we need to use Win32 API for our .Net applications. It's simple enough with Platform Invoke if you have Win32 skill, but we do not always have time to dig the ancient documentation, declare the special types that are compatible with Win32, find the values of the Win32's constants and so on. Nostalgia .Net offers several simple-to-use classes, and components that will allow you to forget about the headache of Win32 and just use the power of Win32 in your application the same way as you use the native. Net classes. More » |
| Recommended software for developers |
 |
|
Ultimate Pack |
|
Component pack for Delphi and C++ Builder that contains runtime form designer, runtime object inspector, print suite and much more for the very special price. More » |
 |
|
Form Designer .Net |
|
Unique runtime form design solution that allows to edit any form in .Net WinForms application at runtime with full source codes for only 300 euro! More » |
 |
|
Print Suite .Net |
|
Print Suite .Net is a set of components for easy printing texts, images and grids from your WinForms applications. Full C# source codes are available More » |
 |
|
Gradient Controls .Net |
|
Gradient Controls .Net offers controls with gradient background feature. Labels, panels and so on... Full C# source codes are available More » |
 |
|
Greatis iGrid |
|
iGrid plots drawing grid right over your desktop, so you can use it everywhere, with any drawing application without any special plugins for different graphic editors. More » |
All the contacts and projectsDmitry Vasiliev (just.dmitry)
Related LinksSoftware for Visual Studio .NET developers Software for Delphi and C++ Builder developers Software for Visual Basic 6 developers Delphi Tips&Tricks MegaDetailed.NET More Online Helps Win32 Programmer's Reference Win32 Multimedia Programmer's Reference OLE Programmer's Reference Microsoft Windows Pen API Programmer's Reference Microsoft Windows Sockets 2 Reference Microsoft Windows Telephony API (TAPI) Programmer's Reference Unix Manual Pages
|