Home > Software engineering >  Why MFC play background music cannot be achieved
Why MFC play background music cannot be achieved

Time:10-07

#include
# include "mmsystem. H"
# pragma comment (lib, "Winmm. Lib")



BOOL PlaySound (LPCSTR pszSound, HMODULE hmod, dwords fdwSound);



PlaySound (LPCTSTR IDR_WAVE1, AfxGetInstanceHandle (), SND_RESOURCE | SND_ASYNC);
//PlaySound (" d: \ \ \ \ software \ \ struggle struggle res \ \ 1. Wav ", NULL, SND_FILENAME | SND_ASYNC);


The code to add the correct you can compile but her voice was not heard

CodePudding user response:

Check the PlaySound returns a value to determine whether a function implementation success

https://msdn.microsoft.com/en-us/library/dd743680 (vs. 85). Aspx

CodePudding user response:

Strings are try like this:
_T (" d: \ \ \ \ software \ \ struggle struggle res \ \ 1. Wav ")
  • Related