Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. PlaySound

PlaySound

Scheduled Pinned Locked Moved C / C++ / MFC
csharpc++helpvisual-studiowinforms
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MrEman
    wrote on last edited by
    #1

    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

    A H 2 Replies Last reply
    0
    • M MrEman

      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

      A Offline
      A Offline
      Ali Rafiee
      wrote on last edited by
      #2

      You created a managed application and PlaySound is an unmanaged function. See this for help CodeProject search[^] AliR. Visual C++ MVP

      1 Reply Last reply
      0
      • M MrEman

        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

        H Offline
        H Offline
        Hamid Taebi
        wrote on last edited by
        #3

        Did you include Mmsystem.h_**


        **_

        whitesky


        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups