![]() |
#2
多布斯的喵喵2011-10-16 16:07
|
只有本站会员才能查看附件,请 登录
这段工程代码怎么就不能实现功能呢?

void CMyDlg::OnSearchs()
{
// TODO: Add your control notification handler code here
CStdioFile file;
CString* strSearch;
CString strTemp;
CString pathName;
int i(0);
int count(0);
strTemp="";
CFileDialog geOpenDlg(TRUE);
geOpenDlg.m_ofn.lpstrTitle="请打开批量搜索的数据文件";
geOpenDlg.m_ofn.lpstrFilter="TXT Files(*.txt)\0*.txt\0ALL Files(*.*)\0*.*\0\0";
if(IDOK==geOpenDlg.DoModal())
{
pathName=geOpenDlg.GetPathName();
file.Open(geOpenDlg.GetPathName(),CFile::modeRead);
}
else
{
return;
}
while(file.ReadString(strTemp))
{
count++;
}
file.Close();
file.Open(pathName,CFile::modeRead);
strSearch=new CString[count];
while(file.ReadString(strTemp));
{
strSearch[i]=strTemp;
i++;
}
file.Close();
m_geSearchControl.AttachDispatch(m_geApplication.GetSearchController(),TRUE);
for(i=0;i<count;i++)
{
m_geSearchControl.Search(strSearch[i]);
}
i=0;
IFeatureCollectionGE collect;
strCount+=count;
while(i<strCount)
{
collect=m_geSearchControl.GetResults();
i++;
}
m_geFeature=new IFeatureGE[strCount];
((CListBox*)GetDlgItem(IDC_LIST1))->ResetContent();
for (i=0;i<strCount;i++)
{
m_geFeature[i]=collect.GetItem(i+1);//卡住
((CListBox*)GetDlgItem(IDC_LIST1))->AddString(m_geFeature[i].GetName());
}
strFlag=new CString[strCount];
for(i=0;i<strCount;i++)
{
strFlag[i]="";
}
}