Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Initializing IXMLDOMTextPtr

Initializing IXMLDOMTextPtr

Scheduled Pinned Locked Moved C / C++ / MFC
helpdatabasexmlquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hanno25
    wrote on last edited by
    #1

    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"); } }

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups