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. Need some help

Need some help

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpquestion
2 Posts 2 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.
  • U Offline
    U Offline
    User 1616744
    wrote on last edited by
    #1

    Hi! I downloaded the source code for the simple MP3 player from this site. I am trying to add volume buttons in MFC. I added the buttons and functions with the class wizard in Visual C++ 6.0, but my functions are not working. Here is my code: void CAVIPlayerDlg::OnVolumeDown() { long vol; vol = MCIWndGetVolume(m_Video); vol-=250; MCIWndSetVolume(m_Video,vol); } void CAVIPlayerDlg::OnVolumeUp() { long vol; vol = MCIWndGetVolume(m_Video); vol+=250; MCIWndSetVolume(m_Video,vol); } It runs, but the call MCIWndGetVolume(m_Video) returns 0 each time, and the volume isn't affected. Any ideas?

    Y 1 Reply Last reply
    0
    • U User 1616744

      Hi! I downloaded the source code for the simple MP3 player from this site. I am trying to add volume buttons in MFC. I added the buttons and functions with the class wizard in Visual C++ 6.0, but my functions are not working. Here is my code: void CAVIPlayerDlg::OnVolumeDown() { long vol; vol = MCIWndGetVolume(m_Video); vol-=250; MCIWndSetVolume(m_Video,vol); } void CAVIPlayerDlg::OnVolumeUp() { long vol; vol = MCIWndGetVolume(m_Video); vol+=250; MCIWndSetVolume(m_Video,vol); } It runs, but the call MCIWndGetVolume(m_Video) returns 0 each time, and the volume isn't affected. Any ideas?

      Y Offline
      Y Offline
      ytod
      wrote on last edited by
      #2

      You may need to check if m_Video is a valid MCIWnd handle... If so, use this function to check the error code: MCIWndGetError( ). Good luck!

      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