IRootStorage interface

The IRootStorage interface contains a single method that switches a storage object to a different underlying file and saves the storage object to that file. The save operation occurs even with low-memory conditions and uncommitted changes to the storage object. A subsequent call to IStorage::Commit is guaranteed to not consume additional memory.

When to implement

Storage objects that are based on a file should implement IRootStorage in addition to the IStorage interface. For storage objects that are not file-based, this interface is not necessary.

COM provides an implementation of a storage object, including the IRootStorage interface, as part of its compound file implementation.

When to use

The primary use for the IRootStorage interface is to save a storage object to a file during low-memory conditions. Typically, the container application calls the IRootStorage interface to switch to a new file. This interface is also useful on older systems where limits on file handles can be exceeded.

If you have an IStorage pointer to a compound file object, you can call IStorage::QueryInterface with IID_IRootStorage to obtain a pointer to the IRootStorage interface.

Members

The IRootStorage interface inherits from the IUnknown interface. IRootStorage also has these types of members:

Methods

The IRootStorage interface has these methods.

MethodDescription
SwitchToFile

Copies the file underlying this root storage object, and then associates this storage with the copied file.

 

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps | Windows Store apps]

Minimum supported server

Windows 2000 Server [desktop apps | Windows Store apps]

Header

Objidl.h

IDL

Objidl.idl

Library

Uuid.lib

DLL

Ole32.dll

IID

IID_IRootStorage is defined as 00000012-0000-0000-C000-000000000046

See also

IStorage
StgCreateDocfile

 

 

Community Additions

ADD
Show:
© 2014 Microsoft