void CBezierDlg::OnBnClickedButton3()
{
// TODO: Add your control notification handler code here
TCHAR pszPath[MAX_PATH];
BROWSEINFO bi;
bi.hwndOwner = this->GetSafeHwnd();
bi.pidlRoot = NULL;
bi.pszDisplayName = NULL;
bi.lpszTitle = TEXT("请选择文件夹");
bi.ulFlags = BIF_RETURNONLYFSDIRS | BIF_STATUSTEXT;
bi.lpfn = NULL;
bi.lParam = 0;
bi.iImage = 0;
LPITEMIDLIST pidl = SHBrowseForFolder(&bi);
if (pidl == NULL)
{
return;
}
if (SHGetPathFromIDList(pidl, pszPath))
{
AfxMessageBox(pszPath);
}
Point2d p3[100];
int count=0;
//TCHAR * p= pszPath;
load(p3,&count,pszPath,"1.txt");
for (int i = 0; i < count; i++)
{
points[i].x=p3[i].t;
points[i].y=p3[i].value;
}
n = count;
RedrawWindow();
}
</pre><pre code_snippet_id="655166" snippet_file_name="blog_20150428_1_924807" name="code" class="cpp">
效果图: