int CFileListXml::Onload(const void* param) { m_strFileListXML = _T(""); //上一次加载的文件路径清空 CString strFile = (LPCTSTR)param; if (!CPathUtilEx::IsFileExist(strFile)) { return Error_File_List_File_Is_Not_Exist; } XML_PARSER parser; if (!parser.Load_XML_Document(strFile)) { return Error_File_List_Xml_Format_Wrong; } //项目名称 if (parser.Go_to_Child(NODE_Project)) { m_strProjectName = GetAttribute(parser, ATTRIBUTE_Project_Name); } parser.Go_to_Root(); //X86文件列表 if (parser.Go_to_Child(NODE_X86) && parser.Go_to_Child(NODE_ITEM)) { do { FILE_ITEM item; item.strName = GetAttribute(parser, ATTRIBUTE_ITEM_Name); item.strSrcPath = GetAttribute(parser, ATTRIBUTE_ITEM_Source_Path); item.strDestPath =GetAttribute(parser, ATTRIBUTE_ITEM_Dest_Path); m_x86FileList.push_back(item); } while (parser.Go_to_NextSibling(NODE_ITEM)); } parser.Go_to_Root(); //X64文件列表 if (parser.Go_to_Child(NODE_X64) && parser.Go_to_Child(NODE_ITEM)) { do { FILE_ITEM item; item.strName = GetAttribute(parser, ATTRIBUTE_ITEM_Name); item.strSrcPath = GetAttribute(parser, ATTRIBUTE_ITEM_Source_Path); item.strDestPath = GetAttribute(parser, ATTRIBUTE_ITEM_Dest_Path); m_x64FileList.push_back(item); } while (parser.Go_to_NextSibling(NODE_ITEM)); } parser.Go_to_Root(); m_strFileListXML = strFile; //以便保存时无需设置路径 return Error_File_List_Success; }