有一个程序在2000下没问题,在98下编译却出现一大堆错误。
错误大致为两类:
1。automatically excluding 'IDispatch' while importing type
library 'msxml.dll'2. 'IXMLDOMDocument' is not a member of 'MSXML'
错误大致为两类:
1。automatically excluding 'IDispatch' while importing type
library 'msxml.dll'2. 'IXMLDOMDocument' is not a member of 'MSXML'
dim xmldoc as object
set xmldoc = CreateObject("Microsoft.XMLDOM")
来创建对象
2 如果你使用#import的话,那么可能需要指定xml接口在哪个命名空间
#import "msxml.dll" name_guids
using namespace MSXML; 可还是出现编译错误:
'IXMLDOMElement' is not a member of 'MSXML'
'IXMLDOMDocument' is not a member of 'MSXML'
'IXMLDOMParseError' is not a member of 'MSXML'
#import "msxml.dll" named_guids
using namespace MSXML;保证你的win98上面安装了MSXML, 利用MFC的_com_ptr模式的XMl类, 比如:
HRESULT hr = CoCreateInstance( CLSID_DOMDocument, NULL, CLSCTX_INPROC_SERVER, IID_IXMLDOMDocument, (void**)&m_pDoc );建议还是使用自己的数据结构, 导出的时候利用硬编码写成XML文件, 真正操作DOM还是脚本级别吧, 否则效率不高.