Initializing IXMLDOMTextPtr
-
I will change an the content of a node in a XML-File. It is no problem, to get the specific node and its content. But to change the content of the Node I have to use the function "InsertData" from the class IXMLDOMText. Therefor I have to initialize the IXMLDOMTextPtr. But every time I try this, I get the error message, that the left part of ->"Query Interface" has to point to a class... So what's wrong with that? Below the pasted code to make it a little bit more understandable. Thanks, Hanno CString fileName; CFileFind find; BOOL findFile; IXMLDOMDocument m_iDocPtr; IXMLDOMNodePtr m_iNodePtr; IXMLDOMTextPtr m_iTextPtr; findFile = (find.FindFile(strPath+"\\"+"*.xml",0)); while(findFile != 0) { fileName = find.GetFilePath(); m_iDocPtr->Load((_bstr_t)fileName); m_iFr = m_iDocPtr->createDocumentFragment(); m_iNodePtr = m_iDocPtr->selectSingleNode("//HI"); m_iNodePtr = m_iNodePtr->selectSingleNode("//Hello"); _bstr_t hello= m_iNodePtr->text; if (atoi(hello) == 0) { m_iTextPtr = m_iDocPtr->createTextNode("something"); m_iTextPtr->insertData(2,"something"); } }