[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

HELP - audio in win32 c++ console app

Posted on 2001-09-05
2
Medium Priority
?
432 Views
Last Modified: 2008-01-09
ok, i have already refered to all the comment about using playsound() espcially this article
http://www.experts-exchange.com/jsp/qShow.jsp?qid=20066222

this is my code:

#include <MMSYSTEM.H>
#include <windows.h>


void main()
{
  PlaySound("chimes.wav",NULL,SND_FILENAME|SND_LOOP|SND_ASYNC);
}




the above code is not functionning!
Here are the errors:
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(113) : error C2146: syntax error : missing ';' before identifier 'MMVERSION'

c:\program files\microsoft visual studio\vc98\include\mmsystem.h(113) : fatal error C1004: unexpected end of file found

**i have already added the "winmm.lib" into project/settings -> link -> object/library modules
, but there is no diffrent


can somebody help me out, and pls tell me what type of wav
file that can play(i mean kHz, bit, stereo/mono, wavelength)


Thanks
0
Comment
Question by:Knight_G
2 Comments
 
LVL 2

Accepted Solution

by:
smitty1276 earned 400 total points
ID: 6459656
Have you tried including windows.h FIRST?  I would assume MMSYSTEM.H needs all of the Windows data types, etc., to be defined before hand... especially considering that this line is the one that generated your error:

typedef UINT MMVERSION;

UINT is a Microsoft thing.
0
 

Author Comment

by:Knight_G
ID: 6459794
wow, it really works!!!
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Article by: evilrix
Looking for a way to avoid searching through large data sets for data that doesn't exist? A Bloom Filter might be what you need. This data structure is a probabilistic filter that allows you to avoid unnecessary searches when you know the data defin…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

830 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