PlaySound doesn't play when called!

This is a discussion on PlaySound doesn't play when called! within the Windows Programming forums, part of the Platform Specific Boards category; When (WM_COMMAND,1,0) is called it won't play my ambient like I want, instead it will play the last sound I ...

As you have not specified resource, file or alias, PlaySound() will look for an alias (system event sound ie critical stop), if not found it thinks szSelection is a file name. The file name will not be valid as it has no path or extension hence no sound.