Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
4/8/2010

The SContentRestrictionstructure describes a content restriction, which is used to limit a table view to only those rows that include a column with contents matching a search string.

Syntax

struct { 
  ULONG 
ulFuzzyLevel; 
  ULONG 
ulPropTag; 
  LPSPropValue 
lpProp; 
} SContentRestriction; 

Members

ulFuzzyLevel

Option settings defining the level of precision that the content restriction should enforce when checking for a match.

The lower 16 bits of ulFuzzyLevelapply to properties of type PT_BINARYand PT_STRING8and must be set to one of the following values:

FL_FULLSTRING

To match, the lpPropsearch string must be completely contained in the property identified by ulPropTag.

FL_PREFIX

To match, the lpPropsearch string must appear at the beginning of the property identified by ulPropTag. The two strings should be compared only up to the length of the search string indicated by lpProp.

FL_SUBSTRING

To match, the lpPropsearch string must be contained anywhere within the property identified by ulPropTag.

The upper 16 bits of the ulFuzzyLevelmember apply only to properties of type PT_STRING8and can be set to the following values in any combination:

FL_IGNORECASE

The comparison should be made without considering case.

FL_IGNORENONSPACE

The comparison should ignore Unicode-defined nonspacing characters, such as diacritical marks.

FL_LOOSE

The comparison should result in a match whenever possible, ignoring case and nonspacing characters.

ulPropTag

Property tag identifying the string property to be checked for occurrence of the search string.

lpProp

Pointer to a property value structure containing the string value to use as the search string.

Remarks

There are two property tags in an SContentRestrictionstructure: one in the ulPropTagmember and the other in the ulPropTagmember of the SPropValuestructure 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_COMPLEXis returned when the restriction is used in a call to IMAPITable::Restrict..

The values FL_FULLSTRING, FL_PREFIX, and FL_SUBSTRINGare mutually exclusive. Only one of them can be set, and one of them must be set. Their meanings are fixed, and the provider must implement them exactly as defined. The provider should return MAPI_E_TOO_COMPLEXif it is unable to support these values.

The values FL_IGNORECASE, FL_IGNORENONSPACE, and FL_LOOSEare independent. Anywhere from zero to all three of them can be set. Their definitions are provided as a guideline only, and the provider is free to implement its own specific meaning of each flag. The provider should not return any error indication if it has no implementation of a specified flag.

The result of a content restriction imposed against a property is undefined when the property does not exist. When a client requires well-defined behavior for such a restriction and is not sure whether the property exists for example, it is not a required column of a table it should create an ANDrestriction to join the content restriction with an existence restriction. Use an SExistRestrictionstructure to define the existence restriction and an SAndRestrictionstructure to define the ANDrestriction.

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