bool XMLRW::CreateXml(char* XmlFile) { // 定义一个TiXmlDocument类指针 TiXmlDocument *pDoc = new TiXmlDocument; if (NULL==pDoc) { return false; } TiXmlDeclaration *pDeclaration = new TiXmlDeclaration(_T("1.0"),_T("utf-8"),_T("")); if (NULL==pDeclaration) { return false; } pDoc->LinkEndChild(pDeclaration); // 生成一个根节点:pRootEle TiXmlElement *pRootEle = new TiXmlElement(_T("ROWDATA")); if (NULL==pRootEle) { return false; } pDoc->LinkEndChild(pRootEle); #if ALLTAB_DETECT_CAR_MODE //汽车 total=OracleIO.CAR_BlackTable_GetNum(); #else //电动车 total=OracleIO.ELECAR_BlackTable_GetNum(); #endif if(0==total) { pDlgBlackInout->m_info.Format("数据库无数据"); pDlgBlackInout->GetDlgItem(IDC_STATIC_INFO)->SetWindowText(pDlgBlackInout->m_info); return true; } unsigned long int i; //设置进度条 pDlgBlackInout->m_progress.SetRange32(0,total); pDlgBlackInout->m_progress.SetStep(1); //有N条数据 就有N条这个 for(i=1; (pDlgBlackInout->ThreadFlag) && (i<=total) ;i++) { if(!CreateRow(pRootEle,i)) break; //填写进度 pDlgBlackInout->m_progress.StepIt(); pDlgBlackInout->m_info.Format("已导出:%d / %d 条",i,total); pDlgBlackInout->GetDlgItem(IDC_STATIC_INFO)->SetWindowText(pDlgBlackInout->m_info); } //保存文件 pDoc->SaveFile(XmlFile); return true; }
void CDLGSetBlack::reflush() { // TODO: Add your control notification handler code here UpdateData(TRUE); ListTotal=0; #if ALLTAB_DETECT_CAR_MODE ListTotal=OracleIO.CAR_BlackTable_GetNum(); #else ListTotal=OracleIO.ELECAR_BlackTable_GetNum(); #endif ListNow=0; DisplayerList(); }