Click here to Skip to main content
15,177,535 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Screenshot Error:

<Img src="http://oi41.tinypic.com/2v94429.jpg" width="700px">

Error:
Object reference not set to an instance of an object.
Error is on the line: AxVLCPlugin21.playlist.items.clear()

When I try to clear the vlc playlist within Visual basic.net I get the above error.

Actual Code:

VB
Public Class Form1
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        AxVLCPlugin21.playlist.items.clear()
        AxVLCPlugin21.playlist.add("file:///C:/Users/Andrew/Desktop/MovieTrailer1.avi")
        AxVLCPlugin21.playlist.play()
    End Sub
End Class



How do I fix?
Posted
Updated 19-Feb-21 22:53pm
v4
Comments
Sergey Alexandrovich Kryukov 29-Apr-13 10:25am
   
In what line?
Where is the declaration of AxVLCPlugin21?
—SA
BlueVLC 29-Apr-13 10:29am
   
Its VB.Net you just drag it from the toolbox onto the form

The error is on the line
AxVLCPlugin21.playlist.items.clear()

It may be a problem with the newer VLC 2.x.x plugin versions. I've had nothing but grief with them. The last version that I've had any luck with is:

http://download.videolan.org/pub/videolan/vlc/1.1.9/win32/[^]
   
Comments
BlueVLC 29-Apr-13 19:04pm
   
Tried version 2.5 and worked fine :-)
Have a nice night mate
There is no VLC plugin in the toolbox, so you're using a 3rd party component.

The error is message makes it pretty obvious.

Either AxVLCPlugin21, AxVLCPlugin21.playlist, or AxVLCPlugin21.playlist.items is returning Nothing, of null is C#. You can't call methods or get/set property values on Nothing.

It's impossible to say which one of those is throwing the exception. You'll have to inspect the variables in the debugger when it stops on the line that threw the exception.
   
test without item
AxVLCPlugin21.playlist.clear
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900