void CMyDialog::OnBnClickedOpennc()
{
// TODO: 在此添加控件通知处理程序代码
CString FilePathName;
CFileDialog dlg(TRUE, //TRUE为OPEN对话框,FALSE为SAVE AS对话框
NULL,
NULL,
OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
(LPCTSTR)_TEXT("PDF Files (*.pdf)|*.pdf|All Files (*.*)|*.*||"),
NULL);
if(dlg.DoModal()==IDOK)
{
FilePathName=dlg.GetPathName(); //文件名保存在了FilePathName里
}
else
{
return;
}
}
CFileDialog(BOOL bOpenFileDialog,
LPCTSTR lpszDefExt=NULL,
LPCTSTR lpszFileName=NULL,
DWORD dwFlags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
LPCTSTR lpszFilter=NULL,
CWnd * pParentWnd=NULL);