I'm working with existing code, where I've found that I have to modify some #include preprocessor directives. For example, to change

#include "myhdr.h"

to

#include "..\hfiles\myhdr.h"

I include the original line in a comment just above the changed line:

/*
#include "myhdr.h" original */
#include "..\hfiles\myhdr.h"

When I do this, some subsequent preprocessor lines appear grayed-out. It doesn't always occur, and it's not consistent. I've tried to find what this means by searching the MS help, which triggered an error in their search engine. Can some kind soul please provide a clue as to what it means, and what might be going on?
Thanks --bg.

Recommended Answers

All 2 Replies

It's just a quirk of the text highlighting. I've found that when I'm mucking about with preprocessor directives, the highlighter can't always keep up with me and even though the code is correct, the highlighting is wrong.

Visual C++ editor shows text blocks deselected by conditional compilation directives as grayed (it's a stable state until you don't tread on #if-#else structure).
Check #if-#endif balance and conditions in the new header version...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.