1.添加按钮控件
2.添加按钮的消息响应函数
void CPracticalplayerDlg::OnBnClickedBtnAdd() { // TODO: 在此添加控件通知处理程序代码 CString strPath = "MP3音乐(*.mp3)|*.mp3||";//过滤文件列表 CFileDialog file(true,NULL,NULL,OFN_HIDEREADONLY,strPath,NULL);//创建文件对象并打开 if(file.DoModal() == IDOK)//显示文件打开对话框 { MessageBox("OK"); } }