ILayoutStorage::LayoutScript method (objidl.h)

The LayoutScript method provides explicit directions for reordering the storages, streams, and controls in a compound file to match the order in which they are accessed during the download.


HRESULT LayoutScript(
  [in] StorageLayout *pStorageLayout,
  [in] DWORD         nEntries,
  [in] DWORD         glfInterleavedFlag


[in] pStorageLayout

Pointer to an array of StorageLayout structures.

[in] nEntries

Number of entries in the array of StorageLayout structures.

[in] glfInterleavedFlag

Reserved for future use.

Return value

This function supports the standard return values E_OUTOFMEMORY, E_UNEXPECTED, E_INVALIDARG, and E_FAIL, as well as the following:

Return code Description
STG_E_INVALIDPOINTER The storage layout pointer is invalid.
STG_E_INVALIDFLAG The value of glfInterleavedFlag is invalid.
STG_E_PATHNOTFOUND The new document file name specified is invalid.
STG_E_INSUFFICIENTMEMORY There is not enough memory to complete the operation.
STG_E_INVALIDPARAMETER One of the parameters is invalid.
STG_E_INUSE The BeginMonitor method was called while ILayoutStorage was already monitoring.


To provide explicit layout instructions, the application calls ILayoutStorage::LayoutScript, passing an array of StorageLayout structures. Each structure defines a single storage or stream data block and specifies where the block is to be written in the ILockBytes byte array.

An application can combine scripted layout with monitoring, as the structure of a particular compound file may dictate.

When the optimal data-layout pattern of an entire compound file has been determined, the application calls ILayoutStorage::ReLayoutDocfile to restructure the compound file to match the order in which its data sectors were accessed.


Minimum supported client Windows 2000 Professional [desktop apps | UWP apps]
Minimum supported server Windows 2000 Server [desktop apps | UWP apps]
Target Platform Windows
Header objidl.h
Library Uuid.lib
DLL Ole32.dll

See also