Results 1 to 2 of 2

Thread: Media Player code- should work but doesn't (?)

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2004
    Location
    The Fens, UK
    Posts
    1

    Media Player code- should work but doesn't (?)

    If I create a button on a form in VB.Net, add a COM reference to Windows Media player (so it references msdxm.ocx) and then put the code in:

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

    Dim mp As New MediaPlayer.MediaPlayer
    mp.FileName = "c:\d.mp3"
    mp.play()
    End Sub

    I get the following message when the mp.play() line is reached:

    An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in MP3Test.exe

    Additional information: Exception from HRESULT: 0x800A0005 (CTL_E_ILLEGALFUNCTIONCALL).


    Any ideas why? BTW d.mp3 does exist in the right place. i've also tried the mp.open("c:\d.mp3") method as well with the same result

    ta,
    Rob

  2. #2
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    I think it's some interop problem
    \m/\m/

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