You are expected to do MFStartup(MF_VERSION);
before you start calling other Media Foundation API functions.
Then you print m_cDevices
before it is getting initialized one line below by MFEnumDeviceSources
.
std::cout << "Enumerate devices:" << m_cDevices << std::endl;
hr = MFEnumDeviceSources(pAttributes, &m_ppDevices, &m_cDevices);
Having this fixed, your code will start getting you the devices.