PlaySound的参数太少了

时间:2013-12-29 23:41:01

标签: c

PlaySound("uuuuuu.wav"), NULL, SND_FILENAME

这是我的代码,当我尝试执行并运行它时,我的编译器说:

PlaySound功能的参数太少

我做错了什么?

2 个答案:

答案 0 :(得分:4)

语法错误:

PlaySound("uuuuuu.wav"), NULL, SND_FILENAME
                      ^                    ^
                      |                    |____ ");" missing
                      |_____ This ')' confuses the compiler

PlaySound调用更改为以下内容(请参阅此页面了解Windows开发人员中心示例:http://msdn.microsoft.com/en-us/library/windows/desktop/dd743680(v=vs.85).aspx):

PlaySound(TEXT("uuuuuu.wav"), NULL, SND_FILENAME);

答案 1 :(得分:3)

函数PlaySound需要更多参数。你错过了括号。试试这个

PlaySound(TEXT("uuuuuu.wav"), NULL, SND_FILENAME);