I'm having a very strange error using Visual Studio NET C++.
I'm creating an application using several .h files and I'm colling them
using #include. To avoid call the same file twice in all the code I'm using
the following technique, because I want to work only with basic C ANSI
commands.
#ifndef METHOD_H
#define METHOD_H
#endif /* METHOD_H */
But I don't know why Visual studio "DISABLED" the code and add this
commentary "Inactive Preprocessor Block".
After that, all the code in this section is not been used.
What is this? How can I make this code be not "disabled" any more?
Thank you,
Roby Eisenbraun Martins
Here you are supposed to place all the header contents. Did you?
> #endif /* METHOD_H */
>
> But I don't know why Visual studio "DISABLED" the code and add this
> commentary "Inactive Preprocessor Block".
Because it probably does nothing. Where is the rest of the header?
> After that, all the code in this section is not been used.
Not been used? What do you mean?
> What is this? How can I make this code be not "disabled" any more?
Make sure it affects something. As posted the code affects basically
nothing.
Try to make a clean rebuild. Maybe some precompiled headers are stomping
out all your efforts...
V
Thank you for your help.
Yes, I'm using the methods headers between #define METHOD_H and #endif.
The strange part is the code been disabled!
I'm working just like this:
// Method.h File
#ifndef METHOD_H
#define METHOD_H
// Include Files
// Macro Declarations
// Structs, Enums Declarations
// Method Headers
#endif /* METHOD_H */
// Same Include Files
// Same Macro Declarations
// Same Structs, Enums Declarations
// Method body
// End of File
My guess is that method.h has been included earlier in the unit, probably
as a side effect of including some OTHER include file. Remember, that's
the whole purpose of the #ifndef\#define dance you have.
--
- Tim Roberts, ti...@probo.com
Providenza & Boekelheide, Inc