Share via


SPropertyRestriction

4/8/2010

The SPropertyRestriction structure describes a property restriction, which is used to match a constant with the value of a property.

Syntax

struct { 
  ULONG relop; 
  ULONG ulPropTag; 
  LPSPropValue lpProp; 
} SPropertyRestriction; 

Members

  • relop
    Relational operator to be used in the search. Possible values are as follows:

    RELOP_GE

    The comparison is made based on a greater or equal first value.

    RELOP_GT

    The comparison is made based on a greater first value.

    RELOP_LE

    The comparison is made based on a lesser or equal first value.

    RELOP_LT

    The comparison is made based on a lesser first value.

    RELOP_NE

    The comparison is made based on unequal values.

    RELOP_RE

    The comparison is made based on LIKE (regular expression) values.

    RELOP_EQ

    The comparison is made based on equal values.

  • ulPropTag
    Property tag identifying the property to be compared.
  • lpProp
    Pointer to an SPropValue structure containing the constant value to be used in the comparison.

Remarks

An SPropertyRestriction structure contains two property tags: one in the ulPropTag member and the other in the ulPropTag member of the SPropValue structure pointed to by lpProp. In both tags, MAPI requires only the property type field and ignores the property identifier field. However, the two property types must match or else the error value MAPI_E_TOO_COMPLEX is returned when the restriction is used in a call to IMAPITable::Restrict.

The comparison order is (property value) (relational operator) (constant value).

When a property restriction is passed to IMAPITable::Restrict and the target property does not exist, the results of the restriction are undefined. By creating an AND restriction that joins the property restriction with an existence restriction, a caller can be guaranteed accurate results. Use an SExistRestriction structure to define the existence restriction and an SAndRestriction structure to define the AND restriction.

Multivalued properties can be used in property restrictions if the service provider implementing the table supports them. If supported, multivalued property tags can be used anywhere single-valued property tags can be used. They can be used in IMAPIProp::SetProps, IMAPIProp::GetProps, IMAPITable::SetColumns, IMAPITable::SortTable, and IMAPITable::Restrict.

Requirements

Header mapidefs.h
Windows Embedded CE Windows CE 3.0 and later
Windows Mobile Pocket PC 2002 and later, Smartphone 2002 and later

See Also

Reference

MAPI Structures
SPropValue
SRestriction

Other Resources

Messaging