Click to See Complete Forum and Search --> : PlaySound Problem


May 18th, 1999, 03:39 PM
I have a view containing buttons which when pressed play a sound (*.wav) file. This works fine until a dialog or MessageBox is brought up. When the dialog or MessageBox is closed, the sounds no longer play. It's almost as if they are disabled. No error messages are displayed. Is there a call that I can put in OnActivateView() that will re-activate the sound? The call I'm making to play the *.wav file is as follows:

if (m_bPlaySound) PlaySound(MAKEINTRESOURCE(IDR_WAVE_FILE), NULL, SND_RESOURCE | SND_ASYNC | SND_NOSTOP);

If you have any ideas as to what may be going on I'd appreciate it. I'm using VC++ 5.0.

Thanks,
Charles

hiran
May 18th, 1999, 03:44 PM
Don't know too much about MFC, but...

Is it possible to have message boxes play system sounds when they come up (such as Asterisk, Bell, etc)? Maybe MS does stop the sound on close, whether you asked for one to play or not. If they stop all sound playback, your app's sound might also be stopped.

Is it possible to look into the mesage box source?

Hiran