环境为xp+2003 FEB SDK+VC6.0 .
也装过xp full sdk,2004.8,有装了vs.net2003一直有编译错误如下:
c:\program files\microsoft sdk\include\mshtml.h(5204) : error C2059: syntax error : 'constant'
c:\program files\microsoft sdk\include\mshtml.h(5207) : error C2143: syntax error : missing ';' before '}'
c:\program files\microsoft sdk\include\mshtml.h(5207) : error C2501: 'BoolValue' : missing storage-class or type specifiers
c:\program files\microsoft sdk\include\mshtml.h(63025) : error C2143: syntax error : missing ';' before '}'
c:\program files\microsoft sdk\include\mshtml.h(63025) : error C2143: syntax error : missing ';' before '}'
c:\program files\microsoft sdk\include\mshtml.h(63025) : error C2143: syntax error : missing ';' before '}'
d:\my documents\code\sp1_module_osip\sp1_module_osip\domainconf.h(6) : error C2143: syntax error : missing ';' before '{'
d:\my documents\code\sp1_module_osip\sp1_module_osip\domainconf.h(6) : error C2447: missing function header (old-style formal list?)搞了好久了,大家帮忙啊

解决方案 »

  1.   

    把c:\program files\microsoft sdk\include路径,设为放在C++默认搜索路径的最上面试试。
      

  2.   

    我查看了我自己的mshtml.h文件(vs.net2003自带的库VC\PlatformSDK\include\mshtml.h),好像和你的不同,在5204行就没看见constant,是不是你加上去的,要不把路径放在最后。
    下面是5204行附近的代码:
    EXTERN_C const GUID CLSID_CFramesCollection;
    EXTERN_C const GUID CLSID_CScreen;
    EXTERN_C const GUID CLSID_CWindow;
    EXTERN_C const GUID CLSID_COmWindowProxy;
    typedef 
    enum _htmlCompatMode
        { htmlCompatModeBackCompat = 0,
    htmlCompatModeCSS1Compat = 1,
    htmlCompatMode_Max = 2147483647L
        }  htmlCompatMode;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;
    EXTERN_C const GUID CLSID_CAreasCollection;
    EXTERN_C const GUID CLSID_CMapElement;
    EXTERN_C const GUID CLSID_CAreaElement;
    typedef 
    enum _htmlCaptionAlign
        { htmlCaptionAlignNotSet = 0,
    htmlCaptionAlignLeft = 1,
    htmlCaptionAlignCenter = 2,
    htmlCaptionAlignRight = 3,
    htmlCaptionAlignJustify = 4,
    htmlCaptionAlignTop = 5,
    htmlCaptionAlignBottom = 6,
    htmlCaptionAlign_Max = 2147483647L
        }  htmlCaptionAlign;
      

  3.   

    to yxz_lp() 
    不是我加的,是没有constant的,只是个enum数据
    我同事那就可以打开,他也是2003+2003 sdk+vc6.0
    directories里include和lib的顺序也和我一样,我就不可以打开
    快疯掉了
      

  4.   

    c:\program files\microsoft sdk\include\mshtml.h(5204) : error C2059: syntax error : 'constant'
    //////////////////////////////
    这句报错不是因为constant吗?
      

  5.   

    在错误栏窗口双击这行:
    c:\program files\microsoft sdk\include\mshtml.h(5204) : error C2059: syntax error : 'constant'
    看看有没有constant
      

  6.   

    没有的
    那么多错误都是vc莫名其妙的错误
    vc有的时候有这种错误
    好像一般头文件包含什么的出问题就那样
    我装sdk是为了用tpipv6.henum _BoolValue
        { True = 1,                              //5204
    False = 0,
    BoolValue_Max = 2147483647L
        }  BoolValue;
      

  7.   

    可以编译通过了
    我用vc6.0自带的mshtml.h替代了sdk的那个文件