PDA

View Full Version : Make VS.NET, preprocessor directives


tdauld
07-06-2006, 12:06 AM
I want to build a project with certain C++ preprocessor directives modified from the default. For example, as if #define DEMO was in effect. I can't find specific information about it in the devenv documentation. I'm using Visual Studio version 7.0.

I can think of a few other ways of doing it:

- Create and select a new configuration
- Include a blank header somewhere and write the directives to that from VBP
- Do a search for the commented out #define and replace it with the uncommented version

None of these solutions are ideal. Any suggestions on passing preprocessor directives to devenv or comment on an alternate solution?

Thanks,
Tim

kinook
07-06-2006, 08:07 AM
One approach would be to tweak the .vcproj file(s) with the desired preprocessor directive(s). The attached sample is for VC 7.1 (but should be similar or identical for 7.0).

tdauld
07-07-2006, 12:45 AM
I think I'll stick with replacing predefined commented directives in a header file, as it affords the ability to validate the selected option.

Thanks for a great product, by the way!

Cheers,
Tim