有些COM组件的tlb是做在dll中的,对待这种情况的处理方法如下:
#import <msxml4.dll>
using namespace MSXML2;
try
{
::CoInitialize(NULL);
MSXML2::IXMLDOMDocument2Ptr xml;
xml.CreateInstance(__uuidof(MSXML2::DOMDocument));
if(!xml->load(_bstr_t(m_sFilePath)))
return false;
int i= 1;
bool bNode = TRUE;
MSXML2::IXMLDOMNodePtr node;
_stprintf(strRoot,_T("/%s/%s/Property[%i]"),m_sRootNode,m_sSubNode,i);
i++;
node = xml->selectSingleNode(_bstr_t(strRoot));
if (node)
{
MSXML2::IXMLDOMNamedNodeMapPtr pAttrs = NULL;
MSXML2::IXMLDOMNodePtr pAttrItem;
node->get_attributes(&pAttrs);
}
}
catch(...)
{
return false;
}
请楼主试试
回复 更多评论