Hello for Windows program design, sound debugging record for Windows 98 program

Source: Internet
Author: User

Recently, in the fifth edition of Window program design, I just saw Chapter 3. In chapter 3, a program calls a multimedia Object Library winmm. lib library. Because the library is no longer in the default project, if you do not manually add it, an error will be prompted during compilation and cannot be run, but the Visual C ++ compiler is used in the book, I am using VS2012, so I don't know how to add the library file according to the method in the book. After a long time, I can add the library file ...... Record the problem and try to solve it quickly:

After the code is typed into VS2012, the following error is prompted after Ctrl + F5 is run:

External commands that cannot be parsed. Here the PlaySound function needs to call a library function WINMM. LIB library function. The solution is as follows. However, we recommend a software called EveryThing. At first, I want to find WINMM in my computer. the Library Function LIB is then written into the complete path, and I don't know where the library file is, so I searched the entire computer hard disk with the search tool that comes with win7, who knows it's slow and heartbroken. Someone recommended the everything software, so I downloaded it and found that searching for things on the computer was basically a second kill. It was cool! You can find this software by google. However, it seems that this tool is not needed to solve the current problem. take the following steps:

Step 1: Project-project properties. Here I select Chapter003. Of course, you can right-click the corresponding project in Solution Explorer and select Properties to go to the second step interface.

Step 2:

Add the library file to 4th, namely, add the winmm. lib file. Do not forget to add a semicolon. Then OK.

Compile the program here, run the OK command, and make the sound come out. If the program does not run properly, check whether your program directory is:

In addition, the name of the audio file should not be wrong in the program. It must be exactly the same (of course, no suffix is missing ).

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.