问题
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