我想在MFC写的窗口中播放声音文件,可就是播不出来,大家帮帮忙.下面是我写的一部分程序,看看有什么错误
#include "mmstystem.h"
void Cthe::OnMusic1()
{
// TODO: Add your command handler code here
BOOL PlaySound(IDR_WAVE1,NULL,SND_ASYNC|SND_NODEFAULT );
}
其中IDR_WAVE1是资源文件中声音文件,可为什么就是不行呢?程序提示错误:
'PlaySoundA' : cannot convert parameter 1 from 'const int' to 'const char *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
Error executing cl.exe.
帮帮忙 谢谢
#include "mmstystem.h"
void Cthe::OnMusic1()
{
// TODO: Add your command handler code here
BOOL PlaySound(IDR_WAVE1,NULL,SND_ASYNC|SND_NODEFAULT );
}
其中IDR_WAVE1是资源文件中声音文件,可为什么就是不行呢?程序提示错误:
'PlaySoundA' : cannot convert parameter 1 from 'const int' to 'const char *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
Error executing cl.exe.
帮帮忙 谢谢
解决方案 »
- 关于基于CWnd或者Win32的CreateWindow实现CMenu
- 设置Label(static)透明
- 工具栏上添加按钮之间的间隔线?貌似只能添加间隔,而没有线啊。我用的 VC 2008。
- 求<<Visual c++游戏开发技术与实例>>一书的光盘源代码,谢谢了!!
- VC程序运行慢,但结果却是正确的,有几种原因?????
- dll共享调用和控件焦点的问题
- 有什么方法可以列举出局域网里所有的已开机的电脑的IP?
- 急问,在ADO编程中,_variant_t类型转化到CTime类型?
- 求助:无法定位程序输入点_except_handler4_common 于动态链接库msvcrt.dll上
- Call Back函数问题
- NT服务开的共享内存,应用程序如何访问?
- 大家快来看看吧
playsound(MAKEINTRESOURCE(IDR_WAVE1),NULL,SND_ASYNC|SND_RESOURCE);
可是还是不行啊 提示错误:
FiveChessView.obj : error LNK2001: unresolved external symbol __imp__PlaySoundA@12
Debug/FiveChess.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
要用playsound函数,必须引入winmm.lib库文件。