Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help with PlaySound()

Status
Not open for further replies.

DigitalOx

Programmer
Sep 29, 1998
41
0
0
US
Hello,<br>
<br>
I'm using VC++ 6 and have a dialog based app created with the wizard.<br>
<br>
I'm trying to use PlaySound() to play a wave I have inserted with the wizard into my "WAVE" resources. I have included the Visual C++ Multimedia component, and all is set to go right I think except that I cannot figure out to call the function properly.<br>
<br>
I tried PlaySound("IDR_WAVE1", NULL, SND_RESOURCE ¦ SND_ASYNC) but this does not work as the second param should be of type HMODULE. I can't find in the docs what to pass for this param - it just has hMod there but I don't know how they got that.<br>
<br>
Thanks<br>
DigitalOx
 
Solved it with help by using PlaySound(MAKEINTRESOURCE(IDR_WAVE1), GetWindowModule(NULL), SND_RESOURCE ¦ SND_ASYNC)<br>
<br>
DigitalOx
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top