主题:vc紧急请教
bool playresource(lpstr lpname)
{
bool brtn;
lpstr lpres;
handle hres;
hrsrc hresinfo;
hinstance nl=afxgetinstancehandle();
hresinfo= findresource(nl,lpname,"wave");
if(hresinfo == null)
return false;
hres = loadresource(nl,hresinfo);
if (hres == null)
return false;
lpres=(lpstr)lockresource(hres);
if(lpres==null)
return false;
brtn = sndplaysound(lpres, snd_memory | snd_sync);
if(brtn == null)
return false;
freeresource(hres);
return true;
}
qDlg.cpp(26) : error C2065: 'lpstr' : undeclared identifier
E:\vc\q\qDlg.cpp(26) : error C2146: syntax error : missing ')' before identifier 'lpname'
E:\vc\q\qDlg.cpp(26) : warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
E:\vc\q\qDlg.cpp(26) : error C2059: syntax error : ')'
E:\vc\q\qDlg.cpp(27) : error C2143: syntax error : missing ';' before '{'
E:\vc\q\qDlg.cpp(27) : error C2447: missing function header (old-style formal list?)
E:\vc\q\qDlg.cpp(111) : error C2064: term does not evaluate to a function
Error executing cl.exe.
这个程序编译老是错这些错。我已经加入了winmm.lib啊。可怎么还是出错啊?各位大哥能帮忙吗?
谁有能播放wav文件的vc程序啊?发我一份看看可以吗?小弟初学。希望各位大哥帮忙!
yinyanxiao@itgchn.com
{
bool brtn;
lpstr lpres;
handle hres;
hrsrc hresinfo;
hinstance nl=afxgetinstancehandle();
hresinfo= findresource(nl,lpname,"wave");
if(hresinfo == null)
return false;
hres = loadresource(nl,hresinfo);
if (hres == null)
return false;
lpres=(lpstr)lockresource(hres);
if(lpres==null)
return false;
brtn = sndplaysound(lpres, snd_memory | snd_sync);
if(brtn == null)
return false;
freeresource(hres);
return true;
}
qDlg.cpp(26) : error C2065: 'lpstr' : undeclared identifier
E:\vc\q\qDlg.cpp(26) : error C2146: syntax error : missing ')' before identifier 'lpname'
E:\vc\q\qDlg.cpp(26) : warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
E:\vc\q\qDlg.cpp(26) : error C2059: syntax error : ')'
E:\vc\q\qDlg.cpp(27) : error C2143: syntax error : missing ';' before '{'
E:\vc\q\qDlg.cpp(27) : error C2447: missing function header (old-style formal list?)
E:\vc\q\qDlg.cpp(111) : error C2064: term does not evaluate to a function
Error executing cl.exe.
这个程序编译老是错这些错。我已经加入了winmm.lib啊。可怎么还是出错啊?各位大哥能帮忙吗?
谁有能播放wav文件的vc程序啊?发我一份看看可以吗?小弟初学。希望各位大哥帮忙!
yinyanxiao@itgchn.com