Click here to Skip to main content
15,918,706 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Dialog in CWinThread Pin
Rage27-Nov-02 1:32
professionalRage27-Nov-02 1:32 
GeneralRe: Dialog in CWinThread Pin
rrrado27-Nov-02 4:04
rrrado27-Nov-02 4:04 
GeneralRe: Dialog in CWinThread Pin
Alvaro Mendez27-Nov-02 11:31
Alvaro Mendez27-Nov-02 11:31 
GeneralCListCtrl item editing and OnNotify Pin
devvvy26-Nov-02 22:49
devvvy26-Nov-02 22:49 
GeneralRe: CListCtrl item editing and OnNotify Pin
Rage26-Nov-02 22:52
professionalRage26-Nov-02 22:52 
GeneralRe: CListCtrl item editing and OnNotify Pin
devvvy26-Nov-02 22:56
devvvy26-Nov-02 22:56 
GeneralRe: CListCtrl item editing and OnNotify Pin
Rage27-Nov-02 2:15
professionalRage27-Nov-02 2:15 
GeneralRe: Accessing xml node names using dom... Pin
Alwin7526-Nov-02 22:37
Alwin7526-Nov-02 22:37 
Joan,

I use the following routines to iterate all child nodes with a specific name:

<br />
typedef MSXML::IXMLDOMNodePtr NodePtr;<br />
<br />
// Get a pointer to the first child node with the specified name<br />
// pszName can be NULL to get first child node with any name<br />
<br />
NodePtr CXMLDocument::GetChild(NodePtr pNode, LPCTSTR pszName)<br />
{<br />
   // Goto child node<br />
   if (pNode == 0)<br />
      pNode = m_pDoc;<br />
   pNode = pNode->firstChild;<br />
	<br />
   // Search for node<br />
   while(pNode)<br />
   {<br />
      if (pNode->nodeType == MSXML::NODE_ELEMENT)<br />
      {<br />
         if (!pszName || _tcsicmp((TCHAR*) pNode->nodeName, pszName) == 0)<br />
            return pNode;<br />
       }<br />
       pNode = pNode->nextSibling;<br />
   }<br />
   return 0;<br />
}<br />
<br />
// Get a pointer to the next sibling node with the specified name<br />
// pszName can be NULL to get next sibling node with any name<br />
 <br />
NodePtr CXMLDocument::GetNext(NodePtr pNode, LPCTSTR pszName)<br />
{<br />
   // Goto next node<br />
   if (pNode == 0)<br />
      pNode = m_pDoc;<br />
   pNode = pNode->nextSibling;<br />
	<br />
   // Search for node<br />
   while(pNode)<br />
   {<br />
      if (pNode->nodeType == MSXML::NODE_ELEMENT)<br />
      {<br />
         if (!pszName || _tcsicmp((TCHAR*) pNode->nodeName, pszName) == 0)<br />
            return pNode;<br />
      }<br />
      pNode = pNode->nextSibling;<br />
   }<br />
   return 0;<br />
}<br />


alternatively, you could look into XPath (there is a reference in the XML Parser DSK, which allows you to use pDoc->selectSingleNode("//result/node/buffers") to reference one or more specific elements
in your document.



Alwin
GeneralRe: Accessing xml node names using dom... Pin
Stephane Rodriguez.26-Nov-02 22:46
Stephane Rodriguez.26-Nov-02 22:46 
QuestionHow paiting my dialog background Pin
Leedoriden26-Nov-02 22:18
Leedoriden26-Nov-02 22:18 
AnswerRe: How paiting my dialog background Pin
Rage26-Nov-02 22:53
professionalRage26-Nov-02 22:53 
GeneralWho can give me the algorithm of arranging classes Pin
happyboy26-Nov-02 22:10
happyboy26-Nov-02 22:10 
GeneralRe: Who can give me the algorithm of arranging classes Pin
Christian Graus27-Nov-02 0:06
protectorChristian Graus27-Nov-02 0:06 
Question1 app - 2 Docs - MDI or SDI? Pin
Stefan Bolder26-Nov-02 22:00
sussStefan Bolder26-Nov-02 22:00 
Questionopen file dialog to select a single DIRECTORY and FOLDERS ONLY? Pin
devvvy26-Nov-02 21:52
devvvy26-Nov-02 21:52 
AnswerRe: open file dialog to select a single DIRECTORY and FOLDERS ONLY? Pin
Rage26-Nov-02 22:49
professionalRage26-Nov-02 22:49 
GeneralRe: open file dialog to select a single DIRECTORY and FOLDERS ONLY? Pin
devvvy26-Nov-02 22:51
devvvy26-Nov-02 22:51 
GeneralHidden window Pin
Jerome Conus26-Nov-02 21:47
Jerome Conus26-Nov-02 21:47 
GeneralRe: Hidden window Pin
Shamoon26-Nov-02 22:24
Shamoon26-Nov-02 22:24 
GeneralRe: Hidden window Pin
Jerome Conus27-Nov-02 0:18
Jerome Conus27-Nov-02 0:18 
GeneralUpload/Download Threading GUI Pin
Sparticus26-Nov-02 21:02
Sparticus26-Nov-02 21:02 
QuestionMFC Single Doc / Multi-View? Pin
clintsinger26-Nov-02 19:39
clintsinger26-Nov-02 19:39 
AnswerRe: MFC Single Doc / Multi-View? Pin
Iain Clarke, Warrior Programmer27-Nov-02 4:52
Iain Clarke, Warrior Programmer27-Nov-02 4:52 
GeneralRe: MFC Single Doc / Multi-View? Pin
clintsinger27-Nov-02 7:17
clintsinger27-Nov-02 7:17 
GeneralCString and VC++ 7.0 Pin
Shah Shehpori26-Nov-02 18:16
sussShah Shehpori26-Nov-02 18:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.