The objective here is to be able to tell when a certain file is included.

For example, suppose we have a header file named MyClass.h. In Main.cpp, we want to check if MyClass.h is included, and if not... post an error.

If we use the C-Style #define approach, you do the following in MyClass.h:

Code:
#ifndef _MYCLASS_H_
#define _MYCLASS_H_

// All code here

#endif
Now, in Main.cpp, you simply check if the file is included by doing the following:

Code:
#ifndef _MYCLASS_H_
// post error to output window, forgot the exact command at the moment
Now if we use the C++ style, which is via the #pragma directive, I have no idea how you would be able to tell if a file was included or not.

In MyClass.h:
Code:
#prama once
In Main.cpp:
Code:
????
Any help? Thanks...