的IXMLDOMDocument"没有成员“selectSingleNode [英] IXMLDOMDocument" has no member "selectSingleNode
本文介绍了的IXMLDOMDocument"没有成员“selectSingleNode的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已将我的项目从VS2012迁移到VS2015,目前我收到错误
#import< msxml.tli>
#import< msxml.tli
>
MSXML :: IXMLDOMDocumentPtr gl_pDOMDoc [2] = {NULL,NULL};
尝试
{
ConvertSpecialCharToString(strNewKey); // HSS_03152010
m_strKeypath = m_strETool + // + strkeyLocalMachine + // + strNewKey;
ProcessKeyPath(m_strKeypath); // SSM_03182010
IXMLDOMNodePtr pResultnode = NULL;
pResultnode = gl_pDOMDoc [m_bEnabledEncryption] - > selectSingleNode ((_ bstr_t)m_strKeypath.AllocSysString()); // PDU_03312015 // m_pDOMDoc更改为gl_pDOMDoc [m_bEnabledEncryption]
if (!pResultnode)
{
SearchPathTillCurrentPath(m_strKeypath);
bStatus = BS_SUCCESS;
}
else
bStatus = BS_SUCCESS;
}
catch (...)
{
CString strLog;
strLog.Format( 创建密钥%s时引发异常,m_strKeypath);
LogError(LINE_INFO + strLog);
bStatus = BS_FAIL;
}
我使用的相同代码在VS2012中成功运行,但它在VS2015中出错。
我无法理解原因..?
解决方案
尝试使用#import< msxml6.dll>代替。
Hi,
I have migrated my project from VS2012 to VS2015 and currently I am getting error
#import <msxml.tli>
#import <msxml.tli
>
MSXML::IXMLDOMDocumentPtr gl_pDOMDoc[2] ={NULL,NULL};
try
{
ConvertSpecialCharToString(strNewKey );//HSS_03152010
m_strKeypath = m_strETool + "//" + strkeyLocalMachine + "//" + strNewKey;
ProcessKeyPath(m_strKeypath);//SSM_03182010
IXMLDOMNodePtr pResultnode=NULL;
pResultnode =gl_pDOMDoc[m_bEnabledEncryption]->selectSingleNode((_bstr_t)m_strKeypath.AllocSysString()); //PDU_03312015 // m_pDOMDoc changed to gl_pDOMDoc[m_bEnabledEncryption]
if(!pResultnode)
{
SearchPathTillCurrentPath(m_strKeypath);
bStatus =BS_SUCCESS;
}
else
bStatus = BS_SUCCESS;
}
catch(...)
{
CString strLog;
strLog.Format("Exception raised while creating key %s" ,m_strKeypath);
LogError(LINE_INFO + strLog);
bStatus = BS_FAIL;
}
The same code I am using is running successfully in VS2012 but it gives error with VS2015.
I am not able to understand the reason ..?
解决方案
try using #import <msxml6.dll> instead.
这篇关于的IXMLDOMDocument"没有成员“selectSingleNode的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文