CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 14 of 14
  1. #1
    Join Date
    Dec 2008
    Location
    Step Into(F11)
    Posts
    465

    [RESOLVED] Opening Video File using MMControl in vb

    Can anybody tell me .How should i open Video file MPG/MPEG/BUP Using MMControl.i simple want to open a video file Using Bt_Open Button.and simple want to play Using Bt_Play Button.But the following Code is Not Working.
    Code:
    Private Sub Bt_Play_Click()
    
    MMControl1.Wait = True
    MMControl1.Command = "Play"
    End Sub
    
    Private Sub BtOpen_Click()
    CommonDialog1.ShowOpen
    MMControl1.FileName = CommonDialog1.FileName
    MMControl1.Wait = True
    MMControl1.Command = "Open"
    End Sub

  2. #2
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Opening Video File using MMControl in vb

    Add this, to see if you have a valid path. What is the extension of the file?
    Code:
    Private Sub BtOpen_Click()
    CommonDialog1.ShowOpen
    MMControl1.FileName = CommonDialog1.FileName
    debug.print MMControl1.FileName
    MMControl1.Wait = True
    MMControl1.Command = "Open"
    End Sub
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  3. #3
    Join Date
    Dec 2008
    Location
    Step Into(F11)
    Posts
    465

    Question Re: Opening Video File using MMControl in vb

    Still Not Working .here is the following code .What i have written.Kindly let me know the Idea.
    Any help would be highly appreciated.right now i am trying to open *.Wav file.
    Code:
    Private Sub Bt_Play_Click()
    
    MMControl1.Wait = True
    MMControl1.Command = "Play"
    End Sub
    
    Private Sub BtOpen_Click()
    CommonDialog1.ShowOpen
    MMControl1.FileName = CommonDialog1.FileName
    Debug.Print MMControl1.FileName
    MMControl1.Wait = True
    MMControl1.Command = "Open"
    End Sub
    
    
    
    Private Sub Form_Load()
    Form1.Caption = MMControl1.FileName
    End Sub
    Last edited by firoz.raj; November 9th, 2009 at 11:50 PM.

  4. #4
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Opening Video File using MMControl in vb

    There is no control in the Form_Load code. Post the value of the DEBUG.PRINT statement that I asked for before
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  5. #5
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Opening Video File using MMControl in vb

    Take a look at this:


    Code:
    Option Explicit
    
    ' cdlCFPrinterFonts &H2
    
    ' Save File Options
    '&H2 - Forces a warning before overwriting a file
    '&H8 - Stops default directory from changing
    '&H200 - more than one file can be selected.
    '&H1000 - This makes it so the file must exist.
    '&H2000 - This warns the user before creating a new file.
    
    Private Sub cmdOpen_Click()
      ' CancelError is True.
       On Error GoTo ErrHandler
       CommonDialog1.InitDir = App.Path
       ' Set Flags
        CommonDialog1.Flags = cdlOFNAllowMultiselect Or cdlOFNLongNames
       ' Set filters.
       CommonDialog1.Filter = "All Files (*.*)|*.*|Text" & _
          "Files (*.txt)|*.txt|Batch Files (*.bat)|*.bat"
       '  CommonDialog1.Filter = "AutoForm Files (*.doc) (*.rtf)|*.doc;*.rtf|All " & _
              "Files (*.*)|*.*"
       
       ' Specify default filter.
       CommonDialog1.FilterIndex = 2 ' Default to TEXT
       ' Display the Open dialog box.
       CommonDialog1.ShowOpen
       ' Call the open file procedure.
     '  OpenFile (CommonDialog1.FileName)
       Debug.Print CommonDialog1.FileName
       Exit Sub
    
    ErrHandler:
    ' User pressed Cancel button.
       Exit Sub
    
    End Sub
    
    Private Sub cmdShowColor_Click()
      ' Set Cancel to True
      CommonDialog1.CancelError = True
      On Error GoTo ErrHandler
      ' Set the Flags property
      CommonDialog1.Flags = cdlCFEffects Or cdlCFBoth
      ' Display the Font dialog box
      CommonDialog1.ShowColor
      rtb.BackColor = CommonDialog1.Color
      Exit Sub
    ErrHandler:
      ' User pressed the Cancel button
      Exit Sub
    End Sub
    
    Private Sub cmdShowFont_Click()
      ' Set Cancel to True
      CommonDialog1.CancelError = True
      On Error GoTo ErrHandler
      ' Set the Flags property
      CommonDialog1.Flags = cdlCFEffects Or cdlCFBoth ' cdlCFPrinterFonts
      ' Display the Font dialog box
      CommonDialog1.ShowFont
      If rtb.SelLength = 0 Then
        rtb.SelStart = 0
        rtb.SelLength = Len(rtb.SelRTF)
      End If
      rtb.SelFontName = CommonDialog1.FontName
      rtb.SelFontSize = CommonDialog1.FontSize
      rtb.SelBold = CommonDialog1.FontBold
      rtb.SelItalic = CommonDialog1.FontItalic
      rtb.SelUnderline = CommonDialog1.FontUnderline
      rtb.SelStrikeThru = CommonDialog1.FontStrikethru
      rtb.SelColor = CommonDialog1.Color
      Exit Sub
    ErrHandler:
      ' User pressed the Cancel button
      Exit Sub
    End Sub
    
    Private Sub cmdSaveFile_Click()
        Dim strFileName As String
        Dim ans As Integer
        CommonDialog1.Flags = &H2 ' Overwrite Flag
        CommonDialog1.Filter = "RTF|*.rtf|Text|*.txt"
        CommonDialog1.ShowSave
        On Error GoTo SaveProblems
        strFileName = CommonDialog1.FileName
        If CommonDialog1.FilterIndex = 1 Then
            CommonDialog1.DefaultExt = "rtf"
            rtb.SaveFile strFileName
        Else
            CommonDialog1.DefaultExt = "txt"
            rtb.SaveFile strFileName, rtfText
        End If
        Exit Sub
    SaveProblems:
            MsgBox "Can’t save the file, try again.", vbCritical
        Exit Sub
    End Sub
    
    Private Sub Form_Load()
      Label1.Caption = "Open File into RTB " & vbCrLf & _
                       "Save File from RTB" & vbCrLf & _
                       "Show Font" & vbCrLf & _
                       "Change selected text" & vbCrLf & _
                       "       or all text." & vbCrLf & _
                       "Show Color" & vbCrLf & _
                       "Change BackColor of RTB"
    End Sub
    
    Sub SaveMultipleFiles()
        Dim strOrigDir As String
        Dim strNewDir As String
        Dim varTemp As Variant
        Dim lngIdx As Long
            strNewDir = "D:\Temp\"
            With CommonDialog1
            .Flags = cdlOFNAllowMultiselect Or cdlOFNLongNames Or cdlOFNExplorer
            .ShowSave
            varTemp = Split(.FileName, vbNullChar)
        End With
            If IsArray(varTemp) Then
            If UBound(varTemp) = 0 Then
                FileCopy varTemp(lngIdx), strNewDir & Right$(varTemp(lngIdx), Len(varTemp(lngIdx)) - InStrRev(varTemp(lngIdx), "\"))
            Else
                strOrigDir = varTemp(0)
                For lngIdx = LBound(varTemp) + 1 To UBound(varTemp)
                    FileCopy strOrigDir & "\" & varTemp(lngIdx), strNewDir & varTemp(lngIdx)
                Next
            End If
        End If
    End Sub
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  6. #6
    Join Date
    Dec 2008
    Location
    Step Into(F11)
    Posts
    465

    Question Re: Opening Video File using MMControl in vb

    Can you tell me Why *.bup Video File is Not working .Mpg/Mpeg/Mp3/WMV/WAV file is working.
    But some other type of Audio File is Not Working.Kindly let me know the idea.
    Code:
    Private Sub Bt_Play_Click()
    CommonDialog1.Filter = "VideoFile(*.mpg)|*.mpeg|ALL Files(*.*)|*.*"
    CommonDialog1.ShowOpen
    MMControl1.FileName = CommonDialog1.FileName
    Debug.Print MMControl1.FileName
    MMControl1.Wait = True
    MMControl1.Command = "Open"
    MMControl1.Command = "Prev"
    MMControl1.Command = "PlAY"
    End Sub
    
    Private Sub Form_Load()
    Form1.Caption = MMControl1.FileName
    End Sub

  7. #7
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Opening Video File using MMControl in vb

    Because it (and myself included) don't know what a BUP file is.
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  8. #8
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Opening Video File using MMControl in vb

    If wet don't know what kind of file it is, then how can the MM control? What program DOES open that kind of file? I guess you would have to give that to each person, if it's free to give away. (Most are NOT)
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  9. #9
    Join Date
    Oct 2009
    Posts
    12

    Re: [RESOLVED] Opening Video File using MMControl in vb

    dear,

    A .BUP file is a file on a DVD = "Backup File of the IFO" (see Explorer)
    I don't think MCC can open this.

    br,

  10. #10
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: [RESOLVED] Opening Video File using MMControl in vb

    Doesn't look like it needs to can be opened at all using the MM control:

    http://www.fileinfo.com/extension/bup
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  11. #11
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: [RESOLVED] Opening Video File using MMControl in vb

    One of the programs on the list
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  12. #12
    Join Date
    Apr 2009
    Posts
    394

    Re: [RESOLVED] Opening Video File using MMControl in vb

    This is just a thought... BUT it may be you need the codecs for the extension in question. You might be able to search for the codec using your friends (yahoo, google, ask, answers, bing) or perhaps downloading and installing Media Player Classic. Then again, I could be barking up the wrong tree...



    Good Luck

  13. #13
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,283

    Re: [RESOLVED] Opening Video File using MMControl in vb

    Just search the internet ( Google ) for mp4 codecs. There are also plenty mp4 to mp3 converters out there.

    Are you sure this thread is resolved ¿

  14. #14
    Join Date
    Dec 2008
    Location
    Step Into(F11)
    Posts
    465

    Resolved Re: [RESOLVED] Opening Video File using MMControl in vb

    Are you sure this thread is resolved ¿
    Yes Now This thread is Resolved.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured