WAVEFORMATEX对象为什么找不到

HELLO_wallace 2008-04-23 12:31:40
我包含了#include "mmsystem.h"也连接了winmm.lib 库
但是在生成WAVEFORMATEX对象并初始化对象时,却出现如下错误,是什么 原因呢?
C:\Documents and Settings\whl\桌面\hhhhh\Sound.cpp(36) : error C2065: 'waveformat' : undeclared identifier
C:\Documents and Settings\whl\桌面\hhhhh\Sound.cpp(36) : error C2228: left of '.wFormatTag' must have class/struct/union type
C:\Documents and Settings\whl\桌面\hhhhh\Sound.cpp(37) : error C2228: left of '.nChannels' must have class/struct/union type
C:\Documents and Settings\whl\桌面\hhhhh\Sound.cpp(38) : error C2228: left of '.nSamplesPerSec' must have class/struct/union type
C:\Documents and Settings\whl\桌面\hhhhh\Sound.cpp(38) : error C2065: 'SAMPLE_RATE' : undeclared identifier
C:\Documents and Settings\whl\桌面\hhhhh\Sound.cpp(39) : error C2228: left of '.nAvgBytesPerSec' must have class/struct/union type
C:\Documents and Settings\whl\桌面\hhhhh\Sound.cpp(40) : error C2228: left of '.nBlockAlign' must have class/struct/union type
C:\Documents and Settings\whl\桌面\hhhhh\Sound.cpp(41) : error C2228: left of '.wBitsPerSample' must have class/struct/union type
C:\Documents and Settings\whl\桌面\hhhhh\Sound.cpp(42) : error C2228: left of '.cbSize' must have class/struct/union type
...全文
107 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
HELLO_wallace 2008-04-23
  • 打赏
  • 举报
回复
拼写错误不好意思!
HELLO_wallace 2008-04-23
  • 打赏
  • 举报
回复
试过了不行,我的这些操作时放在一个自定义类里的,
我换成直接在对话框里设置发现能够成功,这是为什么呢?
rageliu 2008-04-23
  • 打赏
  • 举报
回复
Mmreg.h试试

2,543

社区成员

发帖
与我相关
我的任务
社区描述
专题开发/技术/项目 多媒体/流媒体开发
社区管理员
  • 多媒体/流媒体开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧