To Play a .Wav File
Hi,
I wanted to play a.wav file. This is what i have done
DWORD WINAPI PlayRing(LPVOID lpParam)
{
CString strFileToPlay;
strFileToPlay = "Pulse.wav";
BOOL bRet;
bRet = PlaySound(strFileToPlay,NULL,SND_FILENAME|SND_LOOP);
return 0;
}
BOOL CDialogIncomingCall::OnInitDialog(void)
{
CDialog::OnInitDialog();
//play the ring tone thread here and stop it when reject is pressed
HANDLE hThread;
DWORD dwThrdParam = 1;
hThread = CreateThread(NULL, // default
security attributes
0, // use default stack size
PlayRing, // thread function
&dwThrdParam, // argument to thread function
0, // use default creation flags
&dwThreadId); // returns the thread identifier
return 0;
}
But the .wav file is not getting played.
I think this .wav file has to be loaded into the workspace.
i don't know how to do that. Can anyone one tell me the
solution......
Lucky