Help please... PlaySound Win 7

Hi,

Can anyone help with a problem I've got with PlaySound running on Windows 7. I'm porting some software from XP to Win 7 and the application is meant to play a WAV file when an alarm is sounded.

The process is spawned via CreateProcess as follows:

BOOL bSuccess = CreateProcess( NULL,
szCmdLine,
NULL,
NULL,
FALSE,
CREATE_NEW_CONSOLE,
NULL,
NULL,
&Si,
&SCInfo );

PlaySound is called as follows:

PlaySound( szWavFileName, NULL, SND_FILENAME | SND_ASYNC | SND_LOOP );

Now I've created a small MFC dialog with Play/Stop buttons with the call as shown above and it works fine on both XP and Windows 7. But for some reason because its running as a process it doesn't produce the sound.

I've tried loading the WAV file as a resource and using that but it just caused the process to continuing fall over.

Anyone got any ideas?

Help appreciated.
Topic archived. No new replies allowed.