I am having a problem while executing the mciSendCommand statement. I have just a few line of code in which I just play a .wav file. I am able to play it fine for the first time but as soon I make any change to the code it gives me:
(even when i just add coments)
LINK : fatal error LNK1168: cannot open Debug/MciTest.exe for writing
Error executing link.exe.
MciTest.exe - 1 error(s), 0 warning(s)
I understand that there is a process running in the background but I have even used WM_DESTROY---PostQuitMessage(0) in my code.
When I try to use the Process viewer I am not able to remove the program of my .EXE.Why does the application does not get killed even by the Process viewer.
What could be the reason? How can I kill the process.
I have just given a snipped of the code which is relevant:#define
UINT uDeviceId = 0;
// open waveform-audio device
open.dwCallback = (DWORD)hWnd;
open.lpstrDeviceType = "waveaudio";
open.lpstrElementName = "c:\Sample2.wav";
rc = mciSendCommand(0, MCI_OPEN,
mciGetErrorString(rc, msg, MSG_LEN);
MessageBox(hWnd, msg, NULL, MB_ICONSTOP|MB_OK);
// play back sample2.wav
uDeviceId = open.wDeviceID;
play.dwCallback = (DWORD)hWnd;
rc = mciSendCommand(uDeviceId, MCI_PLAY, MCI_NOTIFY,(DWORD)&play);