why mciSendString() to get status position fails in my code?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-12 03:48:11

问题


Is there any way to query mci device to query current playing position so that we can resume from there to play later on ?

cmd.Format(L"status %d waveaudio position",m_iDeviceIDPlayer);

mcirez = mciSendString(cmd,buff.GetBuffer(),1024, NULL);

it gives this error : "The specified device is not open or is not recognized by MCI "

Is there any problem with command ?


回答1:


MCI_STATUS_PARMS status;
status.dwItem = MCI_STATUS_POSITION;
status.dwCallback = 0;

dwReturn = mciSendCommand(m_iDeviceIDPlayer,MCI_STATUS,MCI_STATUS_ITEM|MCI_WAIT,(DWORD_PTR)&status);     

Position -> status.dwReturn is the required position.



来源:https://stackoverflow.com/questions/2207961/why-mcisendstring-to-get-status-position-fails-in-my-code

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!