So I am trying to make a simple DLL to play sounds in another program. I am trying to use the playsound function, and I have it set up, but when I run it in the other program, I get the default beep. Here is my code.
export double sound_manage(const char* file_old,double handler)
{
/*
Handler values:
0 - Play sound
1 - Loop sound
2 - Stop sound
*/
bool good;
double ret;
double op;
if (handler == 0) op = SND_ASYNC;
if (handler == 1) op = SND_LOOP;
if (handler == 2) op = SND_PURGE;
LPCTSTR file;
file = LPCTSTR(file_old);
good = PlaySound(file,NULL,op);
ret = double(good);
return ret;
}
I have included in the linker the winmib or whatever, but I don't know what's going on.
Any help is greatly appreciated!