Hi all,
Greetings ,I have migrated my code from VS2012 to VS2015 and
some part of my code is giving error. I will only put the snippet of the code (because the complete code is very large)
the same code is running on the some other machine (VS2012 and VS2015) but its not running on my machine in(Visual studio 2015)
but its running on VS2012 on my machine also
I just wanted to know the possible causes of this.
#import <msxml.tlb> //this file is imported // IXMLDOMDocumentPtr is declared and initialized MSXML::IXMLDOMDocumentPtr gl_pDOMDoc[2] ={NULL,NULL}; if(m_bEnabledEncryption == true )//If it is En_BSetting file { if( gl_bIsEnBSettingFileDirty == DIRTY)//Check whether EnBesetting file is dirty { //PDU_03312015 - //loadXML is working
hr =gl_pDOMDoc[m_bEnabledEncryption]->loadXML(m_strDOMXML.AllocSysString());//Load the xml file only if its dirty } } //PDU_03312015 + else// it is BSetting file { if( gl_bIsBSettingFileDirty == DIRTY)//check whether BSetting file is dirty { //PDU_03312015 -//loadxml is working
hr =gl_pDOMDoc[m_bEnabledEncryption]->loadXML(m_strDOMXML.AllocSysString());//load the xml file only if its dirty } } } if(m_strDOMXML.IsEmpty()) { BSTR bstrRoot = m_strETool.AllocSysString(); if(gl_pDOMDoc[m_bEnabledEncryption]!=NULL) {//createElement is working
m_pRoot = gl_pDOMDoc[m_bEnabledEncryption]->createElement(bstrRoot); //PDU_03312015 // m_pDOMDoc changed to gl_pDOMDoc[m_bEnabledEncryption] } m_pCurNode = m_pRoot; SysFreeString(bstrRoot); bstrRoot = NULL; if(gl_pDOMDoc[m_bEnabledEncryption]!=NULL) {
//appendchild is not working
//Eror is ->Error:class "MSXML::IXMLDOMDocument" has no member "appendchild"gl_pDOMDoc[m_bEnabledEncryption]->appendChild(m_pCurNode); //PDU_03312015 // m_pDOMDoc changed to gl_pDOMDoc[m_bEnabledEncryption] } } } try { ConvertSpecialCharToString(strNewKey );//HSS_03152010 m_strKeypath = m_strETool + "//" + strkeyLocalMachine + "//" + strNewKey; ProcessKeyPath(m_strKeypath);//SSM_03182010 IXMLDOMNodePtr pResultnode=NULL;//selectsinglenode is not working
//Eror is ->Error:class "MSXML::IXMLDOMDocument" has no member "selectSingleNode"
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; } BSTR xmlstr;
//get_xml is not working
//Eror is ->Error:class "MSXML::IXMLDOMDocument" has no member "get_xml"gl_pDOMDoc[m_bEnabledEncryption]->get_xml(&xmlstr); //PDU_03312015 // m_pDOMDoc changed to gl_pDOMDoc[m_bEnabledEncryption]
m_strDOMXML =xmlstr; int dwCipherbufSize =m_strDOMXML.GetLength();; BYTE *EncrytedBuff = new BYTE[dwCipherbufSize]; BYTE* lpData; lpData =(BYTE*)(LPCTSTR)m_strDOMXML;