64,646
社区成员
发帖
与我相关
我的任务
分享
void GetRoomData(Ktv_RoomArray &tmpKtvRoomArray)
{
long hFile;
const char *filPath = "*.xml";
_finddata_t fileInfo;
hFile =_findfirst(filPath, &fileInfo);
if(hFile == -1)
{
AfxMessageBox("没有可以读取的XML数据文件!");
_findclose(hFile);
return ;
}
do
{
CMarkup xml;
if(!xml.Load(fileInfo.name)
{
AfxMessageBox("加载配置文件失败!");
return ;
}
if(xml.FindElem("class"))
{
if(xml.FindChildElem("content"))
{
xml.IntoElem();
while(xml.FindChildElem("item"))
{
Ktv_Room *item = new Ktv_Room;
.........
tmpKtvRoomArray.push_back(item);
}
xml.OutOfElem();
}
}
}
while (!_findnext(hFile, &fileInfo););
_findclose(hFile); //执行完此处后出错——中断,“用户未处理的断点”,但是调用此函数的地方,设置了断点, /关闭句柄
}