System.NullReferenceException

  • Thread starter Thread starter Cokegod
  • Start date Start date
C

Cokegod

Guest
I have a simple program that plays mp3's, but when i try to call my play sub, it gives me the System.NullReferenceException error.
Here's The Code:

(In a different Form)
Dim a as form1
a.play("C:a.mp3")

(In Form1)

Public Sub Play(ByVal Song As String)
If IsPaused Then
mciSendString("RESUME " & Song, 0&, 0, 0)
IsPaused = False
Else
mciSendString("OPEN " & Song, 0&, 0, 0)
mciSendString("PLAY " & Song, 0&, 0, 0)
End If
End Sub
 
Oh, And the error occurs at this line :
a.play("C:\a.mp3")

Note: Yes I made a typo in the original post and forgot the "/"
Thanks
 
Back
Top