您的位置:首页 > 其它

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

2012-01-09 17:33 579 查看
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();
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: