Comprobación del dispositivo de salida

Después de abrir el secuenciador, debe comprobar si el asignador MIDI estaba disponible y seleccionado como dispositivo de salida. En el ejemplo siguiente se usa el comando MCI_ STATUS para comprobar que el asignador MIDI es el dispositivo de salida del secuenciador MCI.

UINT wDeviceID;      // valid MCI sequencer ID
DWORD dwReturn;
MCI_STATUS_PARMS mciStatusParms;

// Make sure the opened device is the MIDI mapper.

mciStatusParms.dwItem = MCI_SEQ_STATUS_PORT;

if (dwReturn = mciSendCommand(wDeviceID, MCI_STATUS, MCI_STATUS_ITEM,
    (DWORD)(LPVOID) &mciStatusParms))
{
    
    // Error sending MCI_STATUS command. 
    
    return;
}
if (LOWORD(mciStatusParms.dwReturn) == MIDI_MAPPER)
{
    
    // The MIDI mapper is the output device. 
    
}
Else
{
    
    // The MIDI mapper is not the output device. 
    
}