以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 XML工具及XML开发环境 』  (http://bbs.xml.org.cn/list.asp?boardid=7)
----  菜鸟请教:为什么我在VC++6.0中如下代码编译出错?  (http://bbs.xml.org.cn/dispbbs.asp?boardid=7&rootid=&id=25143)


--  作者:vampire_shirley
--  发布时间:12/8/2005 12:35:00 PM

--  菜鸟请教:为什么我在VC++6.0中如下代码编译出错?
#include <msxml2.h>
#import <msxml4.dll>

#include <iostream.h>

using namespace MSXML2;

void main()
{
 IXMLDOMDocumentPtr xmlFile = NULL;
 IXMLDOMElement * xmlRoot = NULL;

 if(FAILED(CoInitialize(NULL)))
 {
  cout << "Initialize failed!" << endl;
 }
 if(FAILED(xmlFile.CreateInstance("Msxml2.DOMDocument.4.0")))
 {
  cout << "Create Instance failed!" << endl;
 }

 cout << "Success!" << endl;
}

//错误是 error C2872: 'IXMLDOMElement' : ambiguous symbol


W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
31.250ms