Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

PlaySound Function

Posted on 2001-09-04
6
Medium Priority
?
759 Views
Last Modified: 2013-11-20
Hi, I Want To Be Able To PLay Wave Files (Or Resource) From My Dialog (MFC).
The Problem Is When I Call The Function PlaySound(...,...,..) Or sndPlaySound(..,..).
The Linker Display A Error Message Like This
unresolved symbol, sndPlaySound@12

So, What's The Problem Here Guys?

(I Put <mmsystem.h> in MyDialog.cpp) Is This The Problem?
0
Comment
Question by:Freekeko
  • 3
  • 2
6 Comments
 
LVL 4

Accepted Solution

by:
jtwine100697 earned 200 total points
ID: 6453023
You need to link with the "Winmm.lib" library.  On your "Project Settings" dialog, go to the "Link" tab, and add "Winmm.lib" to the "Object/Library Modules: edit control.

PS: Some of the "so-called" experts here will not respond to zero or otherwise low-point questions, or are likely to bitch about getting a less then "A" answer, just so you know...

-=- James.
0
 
LVL 4

Expert Comment

by:jtwine100697
ID: 6453028
BTW: Use "PlaySound(...)" instead of sndPlaySound(...): sndPlaySound(...) is only around for backward compatibility.

-=- James.
0
 
LVL 1

Author Comment

by:Freekeko
ID: 6453681
Thanks jtwine.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:Freekeko
ID: 6453683
Thanks jtwine. :)
0
 

Expert Comment

by:manunmonu
ID: 6453902
I want to play mp3 format with mfc.
please send me some code & notes
0
 
LVL 4

Expert Comment

by:jtwine100697
ID: 6454978
> Thanks jtwine. :)

No problem.  Glad I was able to help.

> [manunmonu] I want to play mp3 format with mfc.

The Windows Media SDK has sample applications that should allow you to play a MP3 file, and even extract ID3 information from it.

-=- James.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

783 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question