VB6: MediaPlayer

Discussion in 'Programming' started by Phlenix, Feb 6, 2008.

  1. #1
    How can i load a file in the mediaplayer with a openfile dialog?
    Could someone please gove me a code?
     
    Phlenix, Feb 6, 2008 IP
  2. Phlenix

    Phlenix Peon

    Messages:
    55
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    anyone?:confused:
     
    Phlenix, Feb 7, 2008 IP
  3. nhl4000

    nhl4000 Well-Known Member

    Messages:
    479
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    110
    #3
    Try searching some tutorials on Google, Google is your best bet.
     
    nhl4000, Feb 7, 2008 IP
  4. urstop

    urstop Peon

    Messages:
    224
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Using the opendialog, you can get the path of the file to be opened. Use this path of the file with the media player control and use the play menthod of the media player to play the file.
     
    urstop, Feb 8, 2008 IP
  5. Phlenix

    Phlenix Peon

    Messages:
    55
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I know but everytime i use the name of the mediaplayer it says that its not declared or so. why should i declare that???
     
    Phlenix, Feb 8, 2008 IP
  6. nhl4000

    nhl4000 Well-Known Member

    Messages:
    479
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    110
  7. Phlenix

    Phlenix Peon

    Messages:
    55
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Finally i did it. But always when i debug my program is says something like "exeption" und "hresult".What am i doing wrong? Heres my code:

    Public Class Form1


    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    Button1.Enabled = False
    AxMediaPlayer1.Visible = False
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    AxMediaPlayer1.launchURL(OpenFileDialog1.FileName)

    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    OpenFileDialog1.ShowDialog()
    Button1.Enabled = True
    End Sub
    End Class


    PLease help
     
    Phlenix, Feb 9, 2008 IP
  8. nhl4000

    nhl4000 Well-Known Member

    Messages:
    479
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    110
    #8
    Which line?
     
    nhl4000, Feb 9, 2008 IP