How to disable interface keyword on visual C++ Express 2008?

Problem is that MS #defines interface to struct so that

interface Name {...}

can be used in COM c++ code. (objbase.h:199: #define interface __STRUCT__)

Just #undef interface after including Windows.h ..


Do a

#define interface QQInterface

before your code (eg. in the header file), this way everywhere where the keyword interface is used, the compilers sees "QQInterface", which is not a keyword. If all code includes this define, you will not get compiler or linker errors.


If you are trying to compile reasonably portable C code, it might be worth disabling the Microsoft language extensions (/Za on the command line, Configuration Properties > C/C++ > Language in VS) and see if the code compiles then.