Questions tagged [enum-flags]

167 questions
-2
votes
4 answers

How to make hex vals acceptable to the compiler?

I'm trying to use the code at http://www.pinvoke.net/default.aspx/coredll/playsound.html It causes several err msgs, though, namely: "Unexpected character '×'" 26 times. So, I tried changing the vals to verbatim strings, like so: SND_SYNC =…
B. Clay Shannon-B. Crow Raven
  • 8,547
  • 144
  • 472
  • 862
-3
votes
1 answer

Test that only a single bit is set in Flags Enum

So I have a flags Enum public Enum test { test1 = 1, test2 = 2, test3 = 4, etc. } How can I test that one bit, and only one bit is set? I've 100% done this before but my mind is not working this am!
Liam
  • 27,717
  • 28
  • 128
  • 190
1 2 3
11
12