I personally used many times the API Function PlaySound which is pretty straightforward.I gauratee it works 100%.
For this you need to do the following:
1.In your stdafx.h file you add a line:
#include <mmsystem.h>
2.In system menu Project->Settings->Link->Object/library modules you add winmm.lib to the lib files that you have there.
That's it. You can now call PlaySound API function.
Make sure to put a call to PlaySound with no filename argument - to stop the WAV file you are playing at user request (for example whe he suddenlly closes the application) - otherwise you will get an ASSERT.
Hope of being of some help, s-) Blessed is he who in the name of justice and good will, shepards the week through the valley of darknees...
You can use Windows Media Player as COM object what offers all what you need for plaing not only sounds. Just add an ActiveX based class with ClassWizard. John Fill
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.