Export (0) Print
Expand All

PROPSETFLAG Constants

The PROPSETFLAG constants define characteristics of a property set. The values, listed in the following table, are used in the grfFlags parameter of IPropertySetStorage methods, the StgCreatePropStg function, and the StgOpenPropStg function.

Constant/valueDescription
PROPSETFLAG_DEFAULT
0

If left unspecified, by default only simple property values may be written to the property set. Using simple property values prevents property sets from being transacted in the compound file and stand-alone implementations of IPropertySetStorage. Non-e property values must be used for this purpose.

PROPSETFLAG_NONSIMPLE
1

If specified, nonsimple property values can be written to the property set and the property set is saved in a storage object. Non-simple property values include those with a VARTYPE of VT_STORAGE, VT_STREAM, VT_STORED_OBJECT, or VT_STREAMED_OBJECT. If this flag is not specified, non-simple types cannot be written into the property set. In the compound file and stand-alone implementations, property sets may be transacted only if PROPSETFLAG_NONSIMPLE is specified.

PROPSETFLAG_ANSI
2

If specified, all string values in the property set that are not explicitly Unicode, that is, those other than VT_LPWSTR, are stored with the current system ANSI code page. For more information, see GetACP. Use of this value is not recommended. For more information, see Remarks.

If this value is absent, string values in the new property set are stored in Unicode. The degree of control that this value provides is necessary so that clients using the property-related interfaces can interoperate with standard property sets such as the OLE2 summary information, which may exist in the ANSI code page.

PROPSETFLAG_UNBUFFERED
4

Used only with the StgCreatePropStg and StgOpenPropStg functions; that is, in the stand-alone implementations of property set interfaces. If specified in these functions, changes to the property set are not buffered. Instead, changes are always written directly to the property set. Calls to a property set IPropertyStorage methods will change it. However, by default, changes are buffered in an internal property set cache and are subsequently written to the property set when the IPropertyStorage::Commit method is called.

Setting PROPSETFLAG_UNBUFFERED decreases performance because the property set internal buffer is automatically flushed after every change to the property set. However, writing changes directly will prevent coordination problems. For example, if the storage object is opened in transacted mode, and the property set is buffered. Then, if you call the IStorage::Commit method on the storage object, the property set changes will not be picked up as part of the transaction, because they are in a buffer that has not been flushed yet. You must call IPropertyStorage::Commit prior to calling IStorage::Commit to flush the property set buffer before committing changes to the storage. As an alternative to making two calls, you can set PROPSETFLAG_UNBUFFERED so that changes are always written directly to the property set and are never buffered in the property set's internal cache. Then, the changes will be picked up when the transacted storage is committed.

PROPSETFLAG_CASE_SENSITIVE
8

If specified, property names are case sensitive. Case-sensitive property names are only possible in the version 1 property set serialization format. For more information, see Property Set Serialization.

Remarks

These values can be set and checked using bitwise operations that determine how property sets are created and opened. Property sets are created using the IPropertySetStorage::Create method or the StgCreatePropStg function. They are opened using the IPropertySetStorage::Open method or the StgOpenPropStg function.

It is recommended that property sets be created as Unicode by not setting the PROPSETFLAG_ANSI flag in the grfFlags parameter. It is also recommended that you avoid using VT_LPSTR values, and use VT_LPWSTR values instead. When the property set code page is Unicode, VT_LPSTR string values are converted to Unicode when stored, and converted back to multibyte string values when retrieved. When the code page of the property set is not Unicode, property names, VT_BSTR strings, and nonsimple property values are converted to multibyte strings when stored, and converted back to Unicode when retrieved, all using the current system ANSI code page.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Propidl.h

See also

FmtIdToPropStgName
IPropertySetStorage::Create
IPropertySetStorage::Open
PropStgNameToFmtId
StgCreatePropSetStg
StgCreatePropStg
StgOpenPropStg

 

 

Community Additions

ADD
Show:
© 2014 Microsoft