warning C6317: incorrect operator: logical-not (!) is not interchangeable with ones-complement (~)
This warning indicates that a logical-not (!) is being applied to a constant that is likely to be a bit-flag. The result of logical-not is Boolean; it is incorrect to apply the bitwise-and (&) operator to a Boolean value. Use the ones-complement (~) operator to flip flags.