Nika_Rika
Nika_Rika

Reputation: 627

C++ mixerGetLineInfo returns MMSYSERR_ERROR (Windows 8)

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?

Upvotes: 1

Views: 657

Answers (0)

Related Questions