c:\microsoft visual studio\vc98\include\msxml2.h(38) : error C2146: syntax error : missing ';' before identifier 'IXMLDOMImplementation'
c:\microsoft visual studio\vc98\include\msxml2.h(38) : fatal error C1004: unexpected end of file found
Error executing cl.exe.
Creating browse info file...
BSCMAKE: error BK1506 : cannot open file '.\Debug\TestXml.sbr': No such file or directory出错的位置在:
#ifndef __IXMLDOMImplementation_FWD_DEFINED__
#define __IXMLDOMImplementation_FWD_DEFINED__
typedef interface IXMLDOMImplementation IXMLDOMImplementation;//这句话提示上面的错误
#endif  /* __IXMLDOMImplementation_FWD_DEFINED__ */
奇怪,没有用过xml,还真不知道怎么搞他

解决方案 »

  1.   

    因为你很难确定XML的版本,我一般是这么用的
    #if  !defined(__MSXML3__)   
    #define  __MSXML3__  
    #import  "msxml3.dll"    
    using  namespace  MSXML2;  
    #endif  
     
    上面的放在头文件里
    ......
    IXMLDOMDocument2Ptr  xml;  
    xml.CreateInstance(__uuidof(MSXML2::DOMDocument));  
    xml->load("xxxx.xml");  
     
    CStringArray  timeA,  codeA;  
     
    int  i=  1;  
    BOOL  bNode  =  TRUE;  
    while  (bNode)  
    {  
     
    IXMLDOMNodePtr  node;  
    CString  strRoot;  
     
    strRoot.Format("/InOutStore/OutStore[%d]",  i++);  
    node=xml->selectSingleNode(_bstr_t(strRoot));  
    if  (node)  
    {  
         IXMLDOMNodePtr  nodeCode,  nodeTime;  
         VARIANT  value;  
         CString  strCode  =  strRoot  +  "/code";  
       nodeCode=xml->selectSingleNode(_bstr_t(strCode));  
         nodeCode->get_nodeTypedValue(&value);  
     
       CString  str1(value.bstrVal);  
       SysFreeString(value.bstrVal);  
       codeA.Add(str1);  
     CString  strTime  =  strRoot  +  "/time";  
       nodeTime=xml->selectSingleNode(_bstr_t(strTime  ));  
         nodeTime->get_nodeTypedValue(&value);  
     
       CString  str2(value.bstrVal);  
       SysFreeString(value.bstrVal);  
       timeA.Add(str2);  
    }  
    else  
           bNode  =  FALSE;  
    }
      

  2.   

    XML的文档也是建议这么用的,你可以看一下MS XML 4.0的SDK文档里的DOM Developer's Guide部分
      

  3.   

    goodboyws(深夜不眠者):那里有?
      

  4.   

    http://www.microsoft.com/downloads/info.aspx?na=46&p=1&SrcDisplayLang=en&SrcCategoryId=&SrcFamilyId=3144b72b-b4f2-46da-b4b6-c5d7485f2b42&u=http%3a%2f%2fdownload.microsoft.com%2fdownload%2f9%2f6%2f5%2f9657c01e-107f-409c-baac-7d249561629c%2fmsxml.msi&oRef=http%3a%2f%2fwww.google.co.th%2fsearch%3fhl%3dth%26q%3dms%2bxml%2bparser%2b4%26meta%3d
      

  5.   

    goodboyws(深夜不眠者) ( ):按你的能编译能通过
    MS XML 4.0的SDK?是否有它的文档,我装的是msdn98,找不到
      

  6.   

    如果你已经安装过,在你的开始菜单——程序——MSXML 4.0——Microsoft XML 4.0 Parse SDK
      

  7.   

    老兄:装了sp4没有见到sdk的帮助文档
    因为马上要改程序,没有办法慢慢搞了
      

  8.   

    真的没有,郁闷
    自从装了.net后,问题多多,机器慢慢
      

  9.   

    谢谢啦,装sp4的时候我没有选择安装sdk,郁闷之际
    结贴