Solved

How to play sounds on Visual c++ 6.0

Posted on 2003-11-07
2
438 Views
Last Modified: 2010-04-01
I am used to turbo c++ 3.0

My school uses visual c++ 6 so i want to convert all my files to visual 6.
But my files only work on DoS environments. I need the header files that would replace my DoS files from turbo to visual.

This is hard becouse Visual didnt work the graphics and sound that I had so i need the headers and the syntax examples that would call sound.

Im used to

playsound(45);
delay(100);
from my turbo c 3.0

i have no idea what to include and use for sound in Visual c++ 6.0
0
Comment
Question by:blacken
2 Comments
 
LVL 4

Accepted Solution

by:
n_fortynine earned 25 total points
ID: 9704637
Try this:

#include <mmsystem.h>                 /* For PlaySound */
#pragma  comment(lib, "winmm.lib")    /* Linking to Sound DLL */

PlaySound("click.wav", NULL, SND_FILENAME | SND_ASYNC);

0
 
LVL 5

Expert Comment

by:waelothman
ID: 9705378
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

758 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now