64,281
社区成员
发帖
与我相关
我的任务
分享
void Cmci_Test1Dlg::OnBnClickedButton1()
{
// TODO: Add your control notification handler code here
char buf[128];
MCI_OPEN_PARMS mciOpen;
MCIERROR mciError;
mciOpen.lpstrDeviceType ="mpegvideo";
mciOpen.lpstrElementName ="F:\\TDDOWNLOAD\\Rolling In The Deep.mp3";
mciError = mciSendCommand(0,MCI_OPEN,MCI_OPEN_TYPE | MCI_OPEN_ELEMENT,(DWORD)&mciOpen);
if(mciError)
{
mciGetErrorString(mciError,buf,128);
MessageBox(buf,"ERROR");
}
else{
UINT DeviceID = mciOpen.wDeviceID;
MCI_PLAY_PARMS mciPlay;
mciError = mciSendCommand(DeviceID, MCI_PLAY, 0,(DWORD)&mciPlay);
if(mciError)
{
mciGetErrorString(mciError,buf,128);
MessageBox(buf,"ERROR");
}
}
}