CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Guest

    PlaySound Problem

    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



  2. #2
    Join Date
    May 1999
    Posts
    7

    Re: PlaySound Problem

    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


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured