Click here to Skip to main content
16,016,535 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Some weirdness in Visual Studio 2008 with code highlighting when using preprocessor #if statements.

C#
//.h
// #define VIRTUALMODE 0
#define VIRTUALMODE 1
// #define VIRTUALMODE 2

//.cpp
#if (VIRTUALMODE == 0)
  ...
#endif
#if (VIRTUALMODE == 1)
  ...
#endif
#if (VIRTUALMODE == 2)
  ...
#endif


It does what I expect it to do when running. But VS always "greys out" cases 1 & 2, irrespective of what #define is active. Any ideas?
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900