Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
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:
 
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 29-Apr-13 5:21am
BlueVLC260
Edited 29-Apr-13 5:33am
v4
Comments
Sergey Alexandrovich Kryukov at 29-Apr-13 10:25am
   
In what line?
Where is the declaration of AxVLCPlugin21?
—SA
BlueVLC at 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()
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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/[^]
  Permalink  
Comments
BlueVLC at 29-Apr-13 19:04pm
   
Tried version 2.5 and worked fine :-)
Have a nice night mate
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 406
1 Marcin Kozub 225
2 Sergey Alexandrovich Kryukov 205
3 Raul Iloc 170
4 Maciej Los 164
0 OriginalGriff 8,289
1 Sergey Alexandrovich Kryukov 7,407
2 DamithSL 5,624
3 Maciej Los 4,989
4 Manas Bhardwaj 4,986


Advertise | Privacy | Mobile
Web02 | 2.8.1411023.1 | Last Updated 29 Apr 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100