void CDeleteDlg::OnButton1()
{
// TODO: Add your control notification handler code here
CFileDialog cf(1, NULL, NULL, OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, "File(*.wav)|*.wav|All File(*.*)|*.*|",NULL);
char path[MAX_PATH];
// CString szCurrentPath;
GetCurrentDirectory(MAX_PATH, szCurrentPath);
strcpy(path, szCurrentPath);
cf.m_ofn.lpstrInitialDir = path;
if(cf.DoModal() == IDOK)
{
strcpy(m_strFileName.GetBuffer(MAX_PATH), cf.GetPathName());
UpdateData(FALSE);
m_strFileName.ReleaseBuffer(-1);
}
}
void CDeleteDlg::OnButton2()
{
// TODO: Add your control notification handler code here
//dele(m_strFileName);
if(::DeleteFile(m_strFileName))
MessageBox("删除文件成功");
else
MessageBox("删除文件失败");
}