Hello, I would like to play a wav file whenever I press a button in a dialog-based MFC Application. So, I have used this code in my include block:
#pragma comment(lib, "Winmm.lib")
#include <Mmsystem.h>
...
and this code to play the file:
if (!PlaySound("C:\\...filename...\\song.wav, NULL, SND_FILENAME)
{
exit(1); //error
}
However, the program will not compile, because it does not recognize PlaySound as a proper identifier. It claims that it is an undeclared identifier. Any help would be much appreciated.
Thanks in advance!
One Ring to Rule Them All, One Ring to Find Them, One Ring to Bring Them All, and in the Darkness Bind Them.
#pragma comment(lib, "Winmm.lib")
#include <Mmsystem.h>
...
and this code to play the file:
if (!PlaySound("C:\\...filename...\\song.wav, NULL, SND_FILENAME)
{
exit(1); //error
}
However, the program will not compile, because it does not recognize PlaySound as a proper identifier. It claims that it is an undeclared identifier. Any help would be much appreciated.
Thanks in advance!
One Ring to Rule Them All, One Ring to Find Them, One Ring to Bring Them All, and in the Darkness Bind Them.