#include <iostream>
#include <windows.h>
//I added a library called mmsystem.h
usingnamespace std;
int main()
{
PlaySound("a.wav",NULL,SND_FILENAME);
return 0;
}
it plays the alarm sound(/a), instead of my file. There are no errors, and it compiles fine. Is anything wrong with the code? How can I get it to work? Thanks!
When I create a program in Visual C++ 12, I start it off as a CLR Console application. I don't know if that makes a difference or not. But then, it compiles and runs, so..
Otherwise, I'm at a loss for an answer. Maybe someone wiser can offer a solution. sorry..
LPCSTR is a pointer to a null-terminated string of constant ANSI (8-bit) characters, which is like constchar* (and in the error bob posted, it is the same on his compiler).
The L prefix makes the string literal a string of wide characters, so you are essentially doing something akin to: