1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| #include <cderr.h>
/**
* \brief Browse button procedure : saves selected songs paths in the playlist
*/
void CPlayTyleDlg::OnBrowseBtn()
{
static char const *FILTERS = "Music File |*.mp3;*.ogg;*.wav;*.wma||"; //And so on
CFileDialog openDlg(
TRUE,
NULL,
NULL,
OFN_ALLOWMULTISELECT|OFN_EXPLORER|OFN_FILEMUSTEXIST,
FILTERS,
this
);
//Buffer troubles... why ?
if(openDlg.DoModal() == IDOK)
{
POSITION pos = openDlg.GetStartPosition();
do
{
m_playlist.Add(openDlg.GetNextPathName(pos));
}while(pos != NULL);
}
else if(CommDlgExtendedError() == FNERR_BUFFERTOOSMALL)
{
AfxMessageBox(_T("Trapped"));
}
} |
Partager