Lou
Lou

Reputation: 1493

Compile errors in mshtml.h compiling with VS2008

I'm in the process of moving one of our projects from VS6 to VS2008 and I've hit the following compile error with mshtml.h:

1>c:\program files\microsoft sdks\windows\v6.0a\include\mshtml.h(5272) : error C2143: syntax error : missing '}' before 'constant'
1>c:\program files\microsoft sdks\windows\v6.0a\include\mshtml.h(5275) : error C2143: syntax error : missing ';' before '}'
1>c:\program files\microsoft sdks\windows\v6.0a\include\mshtml.h(5275) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v6.0a\include\mshtml.h(28523) : error C2059: syntax error : '}'
1>c:\program files\microsoft sdks\windows\v6.0a\include\mshtml.h(28523) : error C2143: syntax error : missing ';' before '}'
1>c:\program files\microsoft sdks\windows\v6.0a\include\mshtml.h(28523) : error C2059: syntax error : '}'

Following the first error statement drops into this part of the mshtml.h code, pointing at the "True = 1" line:

EXTERN_C const GUID CLSID_CDocument;
EXTERN_C const GUID CLSID_CScriptlet;
typedef 
enum _BoolValue
    {   True    = 1,
    False   = 0,
    BoolValue_Max   = 2147483647L
    }   BoolValue;

EXTERN_C const GUID CLSID_CPluginSite;

It looks like someone on expert-sexchange also came across this error but I'd rather not dignify that site with a "7 day free trial".

Any suggestions would be most welcome.

Upvotes: 3

Views: 1472

Answers (4)

Lou
Lou

Reputation: 1493

Thanks Guys. I found the right spot for those #undef's. I dropped them into the classes header file just before a #include <atlctl.h> that seemed to do the trick.

And thanks for the tip about that other expert site, I'll have to keep that in mind.

Upvotes: 1

John Boker
John Boker

Reputation: 83729

you might already have the symbols True & False defined, try

#undef True 
#undef False 

before including that file.

Upvotes: 3

Frank Krueger
Frank Krueger

Reputation: 71043

What other incodes do ou have in the currently compiling file? It may be that True has been defined by a macro already as 1. That would explain the error.

Upvotes: 1

Lou Franco
Lou Franco

Reputation: 89232

There is probably a #define changing something. Try running just the preprocessor on your .cpp and generating a .i file. The setting is in the project property pages.

EDIT: Also, you can get the answer from that other expert site by scrolling to the bottom of the page. They have to do that or Google will take them out of their indexes.

Upvotes: 1

Related Questions