July 21st, 2011, 02:28 AM
I am working on codac application in Windows 7. Now somewhere in the middle this application calls this "waveOutOpen" function. But function is generating this MMSYSERR_BADDEVICEID error. In my PC no speaker is attached. The inbuilt speaker is not working. So the volume bar shows cross. But when I attach a headphone in the jack the Cross gets removed from the volumebar, that means that sound drivers are installed. Can someone tell me why this error is coming?
Although it is strange that in GetLastError it says operation completed successfully
mr = waveOutOpen((LPHWAVEOUT)&m_hWaveOut,WAVE_MAPPER,(tWAVEFORMATEX*)&m_wavFmt,0L,0L,0L);
//if(mr != MMSYSERR_NOERROR)
if(mr == MMSYSERR_BADDEVICEID)
0, // Default language
MessageBox( NULL, (LPCTSTR)lpMsgBuf, "Error", MB_OK | MB_ICONINFORMATION );
/*AfxMessageBox("Sound device open error !");
July 21st, 2011, 03:38 AM
Where did you read that GetLastError has anything to do with waveOutOpen function?
Originally Posted by maverick786us
It has nothing!
waveOutOpen itself returns you the error code as it very clear states in the docs:
Returns MMSYSERR_NOERROR if successful or an error otherwise
. Possible error values include the following.
Click Here to Expand Forum to Full Width
This a Codeguru.com survey!