问题是这样的:
    最近看了Charlse Pezold的《Windows程序设计》第三章,看到作者的例子可以朗读,觉得很是好晚,于是就在自己读《深入浅出 MFC》时用的例子,在CMainFrame
类的OnCreate函数中加如了:
::PlaySound("Scribble.wav", NULL, SND_FILENAME | SND_ASYNC);
然后我想设定连接选项,但是当我打开Project->Setting对话框后,并没有发现Link选项卡。不知如何是好!
直接进行连接,又出现如下4个错误:
E:\VC\Scribble\MainFrm.cpp(53) : error C2039: 'PlaySound' : is not a member of '`global namespace''
E:\VC\Scribble\MainFrm.cpp(53) : error C2065: 'PlaySound' : undeclared identifier
E:\VC\Scribble\MainFrm.cpp(53) : error C2065: 'SND_FILENAME' : undeclared identifier
E:\VC\Scribble\MainFrm.cpp(53) : error C2065: 'SND_ASYNC' : undeclared identifier名字空间对我来说是个新东西,请各位指教,我该怎么做,谢谢!另外,.wav音频文件是如何得到的?
自己如何制作一个这样的音频文件?
需要什么硬件或软件上的工具吗?
谢谢!!!!!!!!!

解决方案 »

  1.   

    没有调用头文件
    #include <mmsystem.h>在settting->link->object/library moudle 里真入winmm.lib
      

  2.   

    包含头文件:#include <mmsystem.h> 
    #include <mciavi.h>
    #include <digitalv.h> 
    //{{AFX_INSERT_LOCATION}}
    // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
    #include <MMSystem.h>
    #pragma comment(lib, "winmm.lib")
    #include <vfw.h>
    #pragma comment(lib,"vfw32.lib")
      

  3.   

    或者直接在头文件里加两句
    #include <mmsystem.h>
    #pragma comment(lib,"Winmm.lib")
      

  4.   

    各位对WAV音频文件的生成有何见解?
    谢谢!
      

  5.   

    WAV文件用Windows自带的录音机就可以录制了,哦,还要有一只麦克风哦(没有,那你还是搜索一下硬盘里的.wav文件吧),专业一点的就用Cool Edit Pro处理(专业处理音频及合成软件)。
      

  6.   

    #pragma comment是#pragma一系列的预处理指令之一,下面是MSDN对它的解释
    The comment pragma allows the user to insert comments into an object file or executable file. The lib specifier allows the user to pass this comment to the linker to specify additional libraries to link when using the object module. 
    并不是所有的API都要调用库和包含头文件的
    象涉及到音频,视频,socket之类的一般都要调用
    而窗口类,画图类的就不必要包含了
      

  7.   

    shilong(星矢の诗龙) 的方法好