STGFMT

[This is preliminary documentation and subject to change.]

The STGFMT enumeration values specify the format of a storage object and are used in the StgCreateStorageEx and StgOpenStorageEx functions.

typedef enum tagSTGFMT 
{ 
    STGFMT_STORAGE     = 0, 
    STGFMT_NATIVE      = 1, 
    STGFMT_FILE        = 3, 
    STGFMT_ANY         = 4, 
    STGFMT_DOCFILE     = 5 
} STGFMT; 

Elements

STGFMT_STORAGE
Indicates the file can be any structured storage format, NTFS NSS or a compound file. The new storage functions, StgCreateStorageEx and StgOpenStorageEx, try to create or open an NSS format file first and then fall back to a compound file if the NSS attempt fails. To create an NSS format file, use this value with the StgCreateStorageEx function, and specify a file on a Windows NT 5.0 NTFS drive.
STGFMT_NATIVE
Indicates the file can be NTFS NSS format only. The new storage functions, StgCreateStorageEx and StgOpenStorageEx try to create or open an NSS format file only. These functions return an error if you try to create an NSS format file on a FAT partition or a NTFS 4.0 partition.
STGFMT_FILE
Indicates that the file is a flat file containing native NTFS property sets. The StgCreateStorageEx and StgOpenStorageEx functions return an error if you try to create a native NTFS property set file on a FAT partition or a NTFS 4.0 partition.
STGFMT_DOCFILE
Indicates the file uses the structured storage compound file implementation only. The new storage functions, StgCreateStorageEx and StgOpenStorageEx, try to create or open a compound file only.
STGFMT_ANY
Indicates the system will figure out the file type and use the appropriate structured storage implementation. This value can be used to obtain an interface supported by all the storage formats, such as IPropertySetStorage.

Remarks

You use the STGFMT enumeration to specify what type of storage to access. When a file is created or opened, the structured storage implementation that is used depends on what STGFMT flag you specify and on what type of drive the file is stored.

Flag Windows NT 5.0 NTFS drive Windows NT 4.0 NTFS or any FAT drive
STGFMT_STORAGE NTFS NSS first; then fallback to compound file Compound File
STGFMT_NATIVE NTFS NSS Not allowed
STGFMT_FILE NTFS Property Set Not allowed
STGFMT_DOCFILE Compound File Compound File
STGFMT_ANY Not allowed during create. During open, NSS will be used for structured storage files, otherwise flat file is used. Not allowed during create. During open, Compound File will be used for structured storage files, otherwise Flat File will be used.

Note  At the command line prompt, you can run the "chkntfs /e" command to convert an NTFS 4.0 partition to an NTFS 5.0 partition.

The STGFMT flag specified also determines which interfaces can be returned from the storage functions:

Flag IStorage IStream IProperty
SetStorage
Other

STGFMT_STORAGE Yes No Yes No
STGFMT_NATIVE Yes No Yes No
STGFMT_FILE No Yes Yes No
STGFMT_DOCFILE Yes No Yes No
STGFMT_ANY Yes Yes Yes Yes

QuickInfo

  Windows NT: Use version 5.0 and later.
  Windows CE: Unsupported.
  Header: Declared in oleext.h.

See Also

StgCreateStorageEx, StgOpenStorageEx