Click to See Complete Forum and Search --> : problems with winmm.lib--Urgent!!


anshnen
December 4th, 2005, 04:47 PM
Hi,

I am trying to play a wave file using PlaySound API. I have added Winmm.lib in the dependencies and also included mmsystem.h and windows.h

But some how the it fails to play the wave file. Please help.

golanshahar
December 4th, 2005, 05:18 PM
did you check ::GetLastError() (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/debug/base/getlasterror.asp) to see why it failing? did you enter in debug mode to see if function succeed or not?

and please post some code.

Cheers

Marc G
December 5th, 2005, 03:09 AM
Please post the code you use to play the sound.
Are you getting compile time errors or runtime errors?
What is the exact error you get?

yiannakop
December 6th, 2005, 05:14 AM
What exactly do you mean by "fail"? The program does not crash, but the sound is not played, or does the program crash? If you simply cannot hear the sound (instead of that you hear a "beep"), then you have probably given the 1st argument (the filename of the audio file to play) wrong.