• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
张纯睿
博客园    首页    新随笔    联系   管理    订阅  订阅

LD SDK LDCControlDll 中 CXMLFile的进一步使用方法,建议以后改进

 1、遍历子节点
                DWORD dRes;
                if ( 0 == (dRes=xmloper.selectFirstChildNode()) )
                {
                 // nodetxt = "Programe"
                 while (0==dRes)
                 {
                  CString strProg;
                  xmloper.readNodeValue(strProg);
                  
                  CDocument *pDoc = this->OpenDocumentFile(strProg);
                  dRes = xmloper.selectNextNode();
                 }
                 xmloper.selectParentNode();
                }
                
              2、获取节点ID
                xmloper.readNodeAttribute(_T("ID"), strID);
                nScreenID = _ttoi(strID);

 

              3、添加子节点属性操作,                   
              4、在子节点查找,   
                // !!在一组节点中找到符合条件的节点,并得到他的ID
                xmloper.selectRootNode();
                xmloper.selectNode(_T("/Root/ScreenProgrames"), 2);
                DWORD dRes;
                if ( 0 == (dRes=xmloper.selectFirstChildNode()) )
                {
                 // nodetxt = "Programe"
                 while (0==dRes)
                 {
                  CString strProg;
                  xmloper.readNodeValue(strProg);
                  if (0==strProg.Compare(lpszPathName))!!!
                  {
                   xmloper.readNodeAttribute(_T("ID"), strID);
                   nScreenID = _ttoi(strID);
                   break;
                  }
                  
                 ` dRes = xmloper.selectNextNode();
                 }
                 xmloper.selectParentNode();
                }      

posted @ 2012-01-09 17:33  张纯睿  阅读(155)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3