This line seems to intermittently cause a timeout in my code:
status = ml.getDevInfo(&(devices.m_psa), &(ledCount.m_psa)); //the function will modify the pointer to the descriptor .m_psa, which is itself a pointer to the actual safearray
better seems to be:
SAFEARRAY *psad = NULL, *psal = NULL; status = _GetDeviceInfo(&(psad), &(psal)); if (status == MLAPI_OK) { devices.Attach(psad); ledCount.Attach(psal); // do your stuff }