Property Types

A property type identifies the data type of the property’s value, such as PT_LONG or PT_BOOLEAN. The set of MAPI property types is defined in the MAPIDEFS.H header file. All properties must correspond to one of these types, whether they are defined by MAPI, by client applications, or by service providers. All property types are data types of the underlying operating system, and some types relate to OLE properties.

Property type names are represented by constants that follow a similar naming convention to the one used for property tags. All property types have two parts: the prefix “PT_” and a string that describes the data type, such as LONG or STRING8.

Property types can be single-valued or multivalued. A single-valued property contains one value, such as an integer, Boolean, character string, sized array of bytes, or structure.

A multivalued property contains multiple values of its type. To represent a multivalued property, the MV_FLAG flag is combined with the base property type in a logical OR operation. If supported, a multivalued property can be used anywhere that a single-valued property can be used.

The following illustration shows the structure of a multivalued property of type PT_LONG. The value is no longer a single variable; it is made up of a pointer that points to an array of values and a count of the number of values in the array.

Multivalued property structure

Although support for multivalued properties is optional, Microsoft recommends that clients and service providers support both single-valued and multivalued properties. Doing so enables greater interaction between MAPI-compliant components.