最近学校实验要写一个WAV播放器,因为以前没用过VC,今天刚上网找了点资料试着弄了一下..有个问题,不知道怎么解决才好...在编译程序的时候,出现这么一堆错误..MIDIPlayDlg.cpp
C:\Program Files\Microsoft Visual Studio\MyProjects\MIDIPlay\MIDIPlayDlg.cpp(207) : error C2065: 'm_Position' : undeclared identifier
C:\Program Files\Microsoft Visual Studio\MyProjects\MIDIPlay\MIDIPlayDlg.cpp(207) : error C2228: left of '.SetRange' must have class/struct/union type
C:\Program Files\Microsoft Visual Studio\MyProjects\MIDIPlay\MIDIPlayDlg.cpp(208) : error C2228: left of '.SetPos' must have class/struct/union type
C:\Program Files\Microsoft Visual Studio\MyProjects\MIDIPlay\MIDIPlayDlg.cpp(301) : error C2065: 'm_position' : undeclared identifier
C:\Program Files\Microsoft Visual Studio\MyProjects\MIDIPlay\MIDIPlayDlg.cpp(301) : error C2228: left of '.SetPos' must have class/struct/union type
执行 cl.exe 时出错.相关代码段为:
void CMIDIPlayDlg::OnPlay()
{
// TODO: Add your control notification handler code here
isPause=true;
SetTimer(1,33,NULL);
mciSendCommand(m_wDeviceID,MCI_CLOSE,0,NULL);
MCI_OPEN_PARMS mciOpen;
MCI_PLAY_PARMS mciPlay;
mciOpen.lpstrElementName=strFileName.GetBuffer(strFileName.GetLength());
mciSendCommand(NULL,MCI_OPEN,MCI_OPEN_ELEMENT,(DWORD)(LPVOID)&mciOpen);
m_wDeviceID=mciOpen.wDeviceID;
MCI_STATUS_PARMS mciStatusParms;
mciStatusParms.dwItem=MCI_STATUS_LENGTH;
mciSendCommand(m_wDeviceID,MCI_STATUS,MCI_WAIT|MCI_STATUS_ITEM,(DWORD)(LPVOID)&mciStatusParms);
m_dLength=mciStatusParms.dwReturn;
mciSendCommand(m_wDeviceID,MCI_PLAY,0,(DWORD)(LPVOID)&mciPlay);
m_position.SetRange(0,m_dLength); //问题所在
m_position.SetPos(0); //问题所在}但是问题出在哪我实在看不出来..m_position这种东西不可以直接用的吗..?望大大们指点
C:\Program Files\Microsoft Visual Studio\MyProjects\MIDIPlay\MIDIPlayDlg.cpp(207) : error C2065: 'm_Position' : undeclared identifier
C:\Program Files\Microsoft Visual Studio\MyProjects\MIDIPlay\MIDIPlayDlg.cpp(207) : error C2228: left of '.SetRange' must have class/struct/union type
C:\Program Files\Microsoft Visual Studio\MyProjects\MIDIPlay\MIDIPlayDlg.cpp(208) : error C2228: left of '.SetPos' must have class/struct/union type
C:\Program Files\Microsoft Visual Studio\MyProjects\MIDIPlay\MIDIPlayDlg.cpp(301) : error C2065: 'm_position' : undeclared identifier
C:\Program Files\Microsoft Visual Studio\MyProjects\MIDIPlay\MIDIPlayDlg.cpp(301) : error C2228: left of '.SetPos' must have class/struct/union type
执行 cl.exe 时出错.相关代码段为:
void CMIDIPlayDlg::OnPlay()
{
// TODO: Add your control notification handler code here
isPause=true;
SetTimer(1,33,NULL);
mciSendCommand(m_wDeviceID,MCI_CLOSE,0,NULL);
MCI_OPEN_PARMS mciOpen;
MCI_PLAY_PARMS mciPlay;
mciOpen.lpstrElementName=strFileName.GetBuffer(strFileName.GetLength());
mciSendCommand(NULL,MCI_OPEN,MCI_OPEN_ELEMENT,(DWORD)(LPVOID)&mciOpen);
m_wDeviceID=mciOpen.wDeviceID;
MCI_STATUS_PARMS mciStatusParms;
mciStatusParms.dwItem=MCI_STATUS_LENGTH;
mciSendCommand(m_wDeviceID,MCI_STATUS,MCI_WAIT|MCI_STATUS_ITEM,(DWORD)(LPVOID)&mciStatusParms);
m_dLength=mciStatusParms.dwReturn;
mciSendCommand(m_wDeviceID,MCI_PLAY,0,(DWORD)(LPVOID)&mciPlay);
m_position.SetRange(0,m_dLength); //问题所在
m_position.SetPos(0); //问题所在}但是问题出在哪我实在看不出来..m_position这种东西不可以直接用的吗..?望大大们指点
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货