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. Query about MCI(Media Control Interface)

Query about MCI(Media Control Interface)

Scheduled Pinned Locked Moved C / C++ / MFC
databasehelpquestion
8 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.
  • R Offline
    R Offline
    Raja Bose C Leo
    wrote on last edited by
    #1

    hi everyone, I used the MCI controls to play the video files... I can able to play *.vob *.dat *.mpg files but the problem i was facing is that I am NOT able to play mpeg 2 files with m2p extensions .... Can anyone tell me whether MCI supports m2p format files? Thanks in advance With regards

    Raja Bose

    H 1 Reply Last reply
    0
    • R Raja Bose C Leo

      hi everyone, I used the MCI controls to play the video files... I can able to play *.vob *.dat *.mpg files but the problem i was facing is that I am NOT able to play mpeg 2 files with m2p extensions .... Can anyone tell me whether MCI supports m2p format files? Thanks in advance With regards

      Raja Bose

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

      If you set lpstrDeviceType to MCI_DGV_OPEN_PARMS mciOpen; mciOpen.lpstrDeviceType ="MPEGVIDEO2"; what happens?


      WhiteSky


      R 1 Reply Last reply
      0
      • H Hamid Taebi

        If you set lpstrDeviceType to MCI_DGV_OPEN_PARMS mciOpen; mciOpen.lpstrDeviceType ="MPEGVIDEO2"; what happens?


        WhiteSky


        R Offline
        R Offline
        Raja Bose C Leo
        wrote on last edited by
        #3

        First of all I like to thank you for replying for my message . I dont know where to use your code MCI_DGV_OPEN_PARMS mciOpen; mciOpen.lpstrDeviceType ="MPEGVIDEO2"; Can you help me with this... I traced the application and found out that i am getting the error while calling this function MCIWndCreate(.....) Code Sample :::::::::::::::::::: HWND CSampleMCI::Initialize() { if((c_Player=MCIWndCreate(hwndParent,AfxGetInstanceHandle(), WS_CHILD | WS_VISIBLE | MCIWNDF_NOTIFYALL | MCIWNDF_NOAUTOSIZEWINDOW |MCIWNDF_NOAUTOSIZEMOVIE|MCIWNDF_NOTIFYERROR|MCIWNDF_SHOWALL , m_sPath))==0) MessageBox("Error in initialise"); MCIWndSetTimeFormat(c_Player,"ms"); MCIWndSetActiveTimer(c_Player,100); lVolume=GetVolume(); return c_Player; } Thank you very much Awaiting for your reply... With regards

        Raja Bose

        H 1 Reply Last reply
        0
        • R Raja Bose C Leo

          First of all I like to thank you for replying for my message . I dont know where to use your code MCI_DGV_OPEN_PARMS mciOpen; mciOpen.lpstrDeviceType ="MPEGVIDEO2"; Can you help me with this... I traced the application and found out that i am getting the error while calling this function MCIWndCreate(.....) Code Sample :::::::::::::::::::: HWND CSampleMCI::Initialize() { if((c_Player=MCIWndCreate(hwndParent,AfxGetInstanceHandle(), WS_CHILD | WS_VISIBLE | MCIWNDF_NOTIFYALL | MCIWNDF_NOAUTOSIZEWINDOW |MCIWNDF_NOAUTOSIZEMOVIE|MCIWNDF_NOTIFYERROR|MCIWNDF_SHOWALL , m_sPath))==0) MessageBox("Error in initialise"); MCIWndSetTimeFormat(c_Player,"ms"); MCIWndSetActiveTimer(c_Player,100); lVolume=GetVolume(); return c_Player; } Thank you very much Awaiting for your reply... With regards

          Raja Bose

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

          Is this helpfuls MCI_DGV_OPEN_PARMS mciOpen; mciOpen.dwCallback = 0L; mciOpen.wDeviceID = 0; mciOpen.dwStyle = WS_CHILD; mciOpen.hWndParent = m_hWnd; mciOpen.lpstrElementName = yourfile; mciOpen.lpstrDeviceType ="MPEGVIDEO2"; mciOpen.lpstrAlias ="MPEGVIDEO2"; mciSendCommand(0, MCI_OPEN,(DWORD)(MCI_OPEN_ELEMENT|MCI_OPEN_TYPE |MCI_DGV_OPEN_PARENT|MCI_DGV_OPEN_WS); ... ...


          WhiteSky


          R 1 Reply Last reply
          0
          • H Hamid Taebi

            Is this helpfuls MCI_DGV_OPEN_PARMS mciOpen; mciOpen.dwCallback = 0L; mciOpen.wDeviceID = 0; mciOpen.dwStyle = WS_CHILD; mciOpen.hWndParent = m_hWnd; mciOpen.lpstrElementName = yourfile; mciOpen.lpstrDeviceType ="MPEGVIDEO2"; mciOpen.lpstrAlias ="MPEGVIDEO2"; mciSendCommand(0, MCI_OPEN,(DWORD)(MCI_OPEN_ELEMENT|MCI_OPEN_TYPE |MCI_DGV_OPEN_PARENT|MCI_DGV_OPEN_WS); ... ...


            WhiteSky


            R Offline
            R Offline
            Raja Bose C Leo
            wrote on last edited by
            #5

            Thank you one again for replying hmmm Its giving the same error message (The error message is "The Specified file cannot be played in the specified MCI device. The file may be corrupt, not in correct format or no file name")... I found out one thing that your code had suceeded without error by checking the return value(as given below) ... and also I created a registry value( in regedit) for MPEGVIDEO2 in MCI32 key folder and set the value as MCIQTZ32.DLL is that OK??? .... for MPEGVIDEO I have the key already(so mpeg 1 is playing fine with MCIFMP32.DLL in registry) but for the MPEGVIDEO2 I created new one .... If I didnt create this key, your code returns some error message as their is no DLL linked with MPEGVIDEO2 Devicetype I had included your code in my btnPlay() function in the main dialog is that OK ??? The code snippet for the button play is as follows void CSeamlessPlayerDlg::OnBtnPlay() { if(index == m_PlyLst.GetItemCount()) index=0; char lpszErr[256]; CString SPath=m_PlyLst.GetItemText(index,2); char lpPath[256]; strcpy(lpPath, SPath); /////////////////////////////////////////////////////////////////////////////////// MCI_DGV_OPEN_PARMS mciOpen; mciOpen.dwCallback = 0L; mciOpen.wDeviceID = 0; mciOpen.dwStyle = WS_CHILD; mciOpen.hWndParent = m_hWnd; mciOpen.lpstrElementName = lpPath ; mciOpen.lpstrDeviceType ="MPEGVIDEO2"; mciOpen.lpstrAlias ="MPEGVIDEO2"; MCIERROR err = mciSendCommand( 0,MCI_OPEN, (DWORD)(MCI_OPEN_ELEMENT|MCI_OPEN_TYPE |MCI_DGV_OPEN_PARENT|MCI_DGV_OPEN_WS),(DWORD)(LPVOID)&mciOpen); if(err != 0) { mciGetErrorString(err, lpszErr,256); MessageBox(lpszErr); // display error if failed } //////////////////////////////////////////////////////////////////////////////////// if(m_PlyLst.GetItemCount() != 0) { // mci.Stop(); mci.SetPath(SPath); mci.SetParent(m_video.GetSafeHwnd()); mci.Initialize(); // mci.SetParent(m_video.GetSafeHwnd()); // if(i==m_PlyLst.GetItemCount()) // mci.Initialize(); ::ShowWindow(mci.GetWindowHandle(),SW_MAXIMIZE); mci.Play(); SetTimer(1,1000,NULL); } else { MessageBox("Check your Play List"); } } Thank you, Awaiting for your reply:) With regards

            Raja Bose

            H 1 Reply Last reply
            0
            • R Raja Bose C Leo

              Thank you one again for replying hmmm Its giving the same error message (The error message is "The Specified file cannot be played in the specified MCI device. The file may be corrupt, not in correct format or no file name")... I found out one thing that your code had suceeded without error by checking the return value(as given below) ... and also I created a registry value( in regedit) for MPEGVIDEO2 in MCI32 key folder and set the value as MCIQTZ32.DLL is that OK??? .... for MPEGVIDEO I have the key already(so mpeg 1 is playing fine with MCIFMP32.DLL in registry) but for the MPEGVIDEO2 I created new one .... If I didnt create this key, your code returns some error message as their is no DLL linked with MPEGVIDEO2 Devicetype I had included your code in my btnPlay() function in the main dialog is that OK ??? The code snippet for the button play is as follows void CSeamlessPlayerDlg::OnBtnPlay() { if(index == m_PlyLst.GetItemCount()) index=0; char lpszErr[256]; CString SPath=m_PlyLst.GetItemText(index,2); char lpPath[256]; strcpy(lpPath, SPath); /////////////////////////////////////////////////////////////////////////////////// MCI_DGV_OPEN_PARMS mciOpen; mciOpen.dwCallback = 0L; mciOpen.wDeviceID = 0; mciOpen.dwStyle = WS_CHILD; mciOpen.hWndParent = m_hWnd; mciOpen.lpstrElementName = lpPath ; mciOpen.lpstrDeviceType ="MPEGVIDEO2"; mciOpen.lpstrAlias ="MPEGVIDEO2"; MCIERROR err = mciSendCommand( 0,MCI_OPEN, (DWORD)(MCI_OPEN_ELEMENT|MCI_OPEN_TYPE |MCI_DGV_OPEN_PARENT|MCI_DGV_OPEN_WS),(DWORD)(LPVOID)&mciOpen); if(err != 0) { mciGetErrorString(err, lpszErr,256); MessageBox(lpszErr); // display error if failed } //////////////////////////////////////////////////////////////////////////////////// if(m_PlyLst.GetItemCount() != 0) { // mci.Stop(); mci.SetPath(SPath); mci.SetParent(m_video.GetSafeHwnd()); mci.Initialize(); // mci.SetParent(m_video.GetSafeHwnd()); // if(i==m_PlyLst.GetItemCount()) // mci.Initialize(); ::ShowWindow(mci.GetWindowHandle(),SW_MAXIMIZE); mci.Play(); SetTimer(1,1000,NULL); } else { MessageBox("Check your Play List"); } } Thank you, Awaiting for your reply:) With regards

              Raja Bose

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

              I think you are new on MCI for example if you need to a HWND handle you can see MCI_DGV_STATUS_HWND (MCI_STATUS) if I guess is true see examples on codeprojext about MCI but for play you can use of MCI_DGV_PLAY_PARMS mciPlay; mciPlay.dwFrom = mciPlay.dwTo = 0; mciPlay.dwCallback = MAKELONG(hWnd,0); mciSendCommand(/*its return of openmci that you need to get it*/DeviceID, MCI_PLAY,MCI_NOTIFY,(DWORD)&mciPlay); :)


              WhiteSky


              R 1 Reply Last reply
              0
              • H Hamid Taebi

                I think you are new on MCI for example if you need to a HWND handle you can see MCI_DGV_STATUS_HWND (MCI_STATUS) if I guess is true see examples on codeprojext about MCI but for play you can use of MCI_DGV_PLAY_PARMS mciPlay; mciPlay.dwFrom = mciPlay.dwTo = 0; mciPlay.dwCallback = MAKELONG(hWnd,0); mciSendCommand(/*its return of openmci that you need to get it*/DeviceID, MCI_PLAY,MCI_NOTIFY,(DWORD)&mciPlay); :)


                WhiteSky


                R Offline
                R Offline
                Raja Bose C Leo
                wrote on last edited by
                #7

                Thank you once again for replying I had refered a sample "EY player" from code project and I developed my own application using MCI ... and also i am new to MCI.... Actual problem I am getting is that I am not able to play MPEG 2 files alone(with extension m2p and mp2)... It is working fine with mpeg 1, vob, avi and dat files.... hmmmm ok as you had said I will see some more samples from code project and if I have anymore doubt i will contact you... Thank you With Regards

                Raja Bose

                H 1 Reply Last reply
                0
                • R Raja Bose C Leo

                  Thank you once again for replying I had refered a sample "EY player" from code project and I developed my own application using MCI ... and also i am new to MCI.... Actual problem I am getting is that I am not able to play MPEG 2 files alone(with extension m2p and mp2)... It is working fine with mpeg 1, vob, avi and dat files.... hmmmm ok as you had said I will see some more samples from code project and if I have anymore doubt i will contact you... Thank you With Regards

                  Raja Bose

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

                  I hope you find your answer early :)


                  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