Jump to content
Xtreme .Net Talk

System.NullReferenceException


Recommended Posts

Guest Cokegod
Posted

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

Guest Cokegod
Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...