I have a application which plays mp3 file using MCI device API. I was able to play mp3 file first time but when I run the same file secon time it gives in following error.
MCI Error
---------------------------
The specified file cannot be played on the specified MCI device. The file may be corrupt, not in the correct format, or no fil
I have used following code to create a device and play the file.
m_Path = _T("res\\phoneringing.mp3");
m_Video = MCIWndCreate( m_hWnd,
AfxGetInstanceHandle(),WS_CHILD|WS_VISIBLE|MCIWNDF_NOMENU|MCIWNDF_NOPLAYBAR,m_Path);
I have observed that when my application creates the device second time using
MCIWndCreate
it throws this error. For this I have handled all the events such as
MCIWndStop
,
MCIWndClose
,
MCIWndDestroy
API's to stop and destroy the created window. But still I am facing the same issue. Can some one help to override this error. I tried with
MCIWNDF_NOERRORDLG
to supress the error dialog but this does not show the error message but I unable to play the file.
Please suggest.