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 !");