While porting the UxTheme project to 2008 from VS 2003, I believe I found a bug in tmschema.h and schemadef.h. These files are necessary to work with Windows XP themes. The following code fragment compiles under 2005 but breaks under 2008:
#include <tmschema.h> #define TMT_ENUMDEF 8 #define TMT_ENUMVAL TEXT('A') #define TMT_ENUM TEXT('B') #define SCHEMA_STRINGS #include <tmschema.h> .... const TMPROPINFO* pPropTable = GetSchemaInfo()->pPropTable; ....At first, I thought the problem was caused by not defining _WIN32_WINNT so I added
#define _WIN32_WINNT 0x0502to my stdafx.h header. No joy. Then I compared the header files tmschema.h and schemadef.h between VS2005 and VS2008. After adding some #pragma message statements to see what was happening during a compile, it was obvious the files were only opened once and never scanned again. Which is what
#pragma oncedoes for you. I went back to the 2005 versions of the files and noticed there were no
#pragma oncestatements. I commented out the statments in the tmschema.h and schemadef.h headers for VS2008 and voila! It started working.