1

I'm trying to run this code (VS2015, MFC, Windows 8):

int _nNumMixers = mixerGetNumDevs(); //returns 3
HMIXER hMixer   = NULL;

//NOERROR
if (mixerOpen(&hMixer, 0, 0, NULL, MIXER_OBJECTF_MIXER) != MMSYSERR_NOERROR)
{
  return FALSE;
}

//NOERROR
MIXERCAPS _mxcaps;
if (mixerGetDevCaps((UINT)hMixer, &_mxcaps, sizeof(MIXERCAPS)) != MMSYSERR_NOERROR)
{
    return FALSE;
}

MIXERLINE mxl;
mxl.cbStruct        = sizeof(MIXERLINE);
mxl.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_WAVEIN;

//!!!! the next returns 1 (MMSYSERR_ERROR - unspecified error)
if (mixerGetLineInfo((HMIXEROBJ)hMixer, &mxl, MIXER_OBJECTF_HMIXER | MIXER_GETLINEINFOF_COMPONENTTYPE) != MMSYSERR_NOERROR) 
{
   mixerClose (hMixer);
   return FALSE;
}

mixerGetLineInfo doesn't work, it always returns MMSYSERR_NOERROR, that means unspecified error. Is that because of Win 8 or what? How to run it?

Nika_Rika
  • 613
  • 2
  • 6
  • 29
  • And what happens in mixerGetLineInfo() ? – retinotop May 04 '17 at 08:31
  • hmmm, I can't go inside it, its declaration is in mmeapi.h – Nika_Rika May 04 '17 at 09:01
  • Looking at the MSDN for [MIXERLINE structure](https://msdn.microsoft.com/en-us/library/windows/desktop/dd757305(v=vs.85).aspx) it says: `dwSource: This member is not used for destination lines and must be set to zero when MIXER_GETLINEINFOF_DESTINATION is specified in the mixerGetLineInfo function`. There are also requirements for other elements of this structure. Basically, the structure needs to Zeroed in my opinion before calling the function. Try `MIXERLINE mxl = {0};` and see if it helps – cha May 05 '17 at 04:56

0 Answers0