PlaySound
-
I am attempting to play a sound when a button is clicked. I am using Microsoft Visual Studio .NET 2003 and to create my project I clicked File->New->Project, chose Visual C++ Projects and then Windows Forms Application (.NET). I then added a button to the form and in the click event I put the following code PlaySound(_T("C:\\Windows\\Media\\chime.wav"), NULL, SND_LOOP); I also included at the top of the file windows.h. The errors that I receive are error C2065: 'SND_LOOP' : undeclared identifier error C3861: 'PlaySound': identifier not found, even with argument-dependent lookup I would appreciate any help. Thanks in advance Keith
-
I am attempting to play a sound when a button is clicked. I am using Microsoft Visual Studio .NET 2003 and to create my project I clicked File->New->Project, chose Visual C++ Projects and then Windows Forms Application (.NET). I then added a button to the form and in the click event I put the following code PlaySound(_T("C:\\Windows\\Media\\chime.wav"), NULL, SND_LOOP); I also included at the top of the file windows.h. The errors that I receive are error C2065: 'SND_LOOP' : undeclared identifier error C3861: 'PlaySound': identifier not found, even with argument-dependent lookup I would appreciate any help. Thanks in advance Keith
You created a managed application and PlaySound is an unmanaged function. See this for help CodeProject search[^] AliR. Visual C++ MVP
-
I am attempting to play a sound when a button is clicked. I am using Microsoft Visual Studio .NET 2003 and to create my project I clicked File->New->Project, chose Visual C++ Projects and then Windows Forms Application (.NET). I then added a button to the form and in the click event I put the following code PlaySound(_T("C:\\Windows\\Media\\chime.wav"), NULL, SND_LOOP); I also included at the top of the file windows.h. The errors that I receive are error C2065: 'SND_LOOP' : undeclared identifier error C3861: 'PlaySound': identifier not found, even with argument-dependent lookup I would appreciate any help. Thanks in advance Keith
Did you include
Mmsystem.h
_**
**_
whitesky