Previous in Contents Next in Contents

The FileDocument Object

The FileDocument object provides methods that support saving and restoring information contained in any persistable object to and from disk.

A persistable object is an object that supports structured storage, a technique used by Component Object Model (COM) objects to save information on disk for later retrieval. A structured storage file contains collections of data that are organized hierarchically into streams and storages. Streams are analogous to conventional files in that they can contain arbitrary data, but many streams can be contained within one structured storage file. (Storages are analogous to directories in a file system, and may contain streams or other storages. The FileDocument object does not make use of storages other than the root storage, which is analogous to the root directory in a file system.)

When you read from or write to structured storage using the FileDocument object, you specify both the name of the structured storage file and the name of the stream. The FileDocument object assumes that the stream is in the root storage of the structured storage file.

For example code, see ReadDictionaryFromFile Method.

The FileDocument object supports the following methods.

Method Description
ReadDictionaryFromFile Retrieves data that has been saved in a structured storage file into a specified instance of the Dictionary object.
ReadFromFile Retrieves data that has been saved in a structured storage file and returns a new data object.
WriteToFile Writes data from a data object (such as a Dictionary object) to a specified stream in a structured storage data file.


© 1997-2000 Microsoft Corporation. All rights reserved.