PlaySound() with resources
Well, I can play sound from .wav files..., but it doesn't work with resources.
Code:
//sound.cpp
#include <iostream>
#include <windows.h>
#include "res.h"
#include "data.rc"
#pragma comment(lib,"winmm")
int main()
{
PlaySound(MAKEINTRESOURCE(ID_SOUND),NULL, SND_ASYNC | SND_RESOURCE);
}
//data.rc
#include "res.h"
ID_SOUND WAVE DISCARDABLE "data.wav"
//res.h
#define ID_SOUND 333
It gives me the following error:
Error 1 error C2059: syntax error : 'constant' c:\documents and settings\olafs.ntworld-9ba1e5e\desktop\misc\programming\visual c++ projects\general\data.rc 2
Whats wrong with my resource? Every tutorial says exactly the same to put in there
Code:
ID_SOUND WAVE DISCARDABLE "data.wav"