The HrStringToRestriction function creates a copy of a MAPI SRestriction structure from a restriction condition.
Header file: | RULECLS.H |
Library: | RULECLS.LIB |
HRESULT HrStringToRestriction(
LPSTR lpszString,
LPVOID lpObjec t,
LPSRestriction FAR * lppRestriction
);
See Return Values.
If HrStringToRestriction fails, lppRestriction is NULL.
The conditional expression grammar used for HrStringToRestriction is as follows:
lpszString parameter:
Condition ::= SimpleCondition | Condition "|" Condition | Condition "&" Condition | "(" Condition ")" | "!" Condition
"|" is the logical OR operator.
"&" is the logical AND operator.
"!" is the logical NOT operator.
Conditional expressions are evaluated from left to right with "|" and "&" having equal precedence. "!" is a unary operator that applies to the operand to its immediate right.
SimpleCondition ::= StringCondition | NumericCondition
StringCondition ::= StringTag "=" StringLiteral | StringTag "#" StringLiteral | StringTag "}" StringLiteral
"=" is the equality operator.
"#" is the inequality operator.
"}" is the contains operator (a "}" b means a contains b).
NumericCondition ::= NumericTag "=" NumericLiteral | NumericTag "#" NumericLiteral | NumericTag ">" NumericLiteral | NumericTag "<" NumericLiteral
The meaning of the NumericCondition operators should be evident.
StringTag ::= PR_xxxx for a property with a string (PT_STRING8) value | "[S" HexNumber "]"
NumericTag ::= PR_xxxx for a property with a numeric (PT_LONG) value | "[S" HexNumber "]"
NumericLiteral ::= DecimalNumber
StringLiteral ::= String enclosed in quotes ("xxx").
HexNumber ::= HexDigit...
DecimalNumber ::= DecimalDigit... | +DecimalDigit... | -DecimalDigit...
If you allocate space for the lpObect buffer using the MAPIAllocateBuffer function, you must free the buffer using the MAPI MAPIFreeBuffer function.
For more information on this function, see Creating a Rule.
For information about the MAPIAllocateBuffer and MAPIFreeBuffer functions and the SRestriction structure, see the MAPI Programmer's Reference.