*SOLVED* Quitting a VB form while VLC Runs crashes Vista x64

All you've ever wanted to know about the ActiveX, Mozilla plugins, the web interface and various PHP extensions
Hani123123
New Cone
New Cone
Posts: 9
Joined: 17 Feb 2009 16:33

*SOLVED* Quitting a VB form while VLC Runs crashes Vista x64

Postby Hani123123 » 18 Feb 2009 21:31

Hi there..
After i managed to integrate VLC in a Visual Basic 2008 form (thanks to revolunet), it seems that I managed to get stuck even worse.
Basically, I made a VB form, I added an axVLC, (AxVLCPlugin21) and a button.
The code for the button:

Code: Select all

Dim webAddress As String = "http://86.55.3.4:8000" AxVLCPlugin21.playlist.items.clear() AxVLCPlugin21.playlist.add(webAddress) AxVLCPlugin21.playlist.play()
After I hit the button, the player loads great, the streaming is flawless, but as soon as I hit the "Close" button

Code: Select all

Me.Close()
Vista throws a bluescreen and starts dumping memory. :shock:

If for example I open my form and I don't load any stream, the form closes properly via the "Close" button.
Please tell me what am I doing wrong? And please be gentle, as I am a total absolute beginner.

Thanks once again !
Last edited by Hani123123 on 25 Feb 2009 14:37, edited 1 time in total.

Hani123123
New Cone
New Cone
Posts: 9
Joined: 17 Feb 2009 16:33

Re: Quitting a VB form while VLC Runs crashes Vista x64 Ultimate

Postby Hani123123 » 19 Feb 2009 13:49

Anyone? Please? This got my project to a grinding halt... I am desperate, and the only way to avoid bluescreen is by killing it via TaskManager..

revolunet
Big Cone-huna
Big Cone-huna
Posts: 515
Joined: 17 Oct 2007 13:16
VLC version: 0.9.8
Operating System: Vista
Location: Paris, France
Contact:

Re: Quitting a VB form while VLC Runs crashes Vista x64 Ultimate

Postby revolunet » 19 Feb 2009 13:51

before closing the form, use something like :

dim itemid as integer = AxVLCPlugin21.playlist.add("vlc://quit");
AxVLCPlugin21.playlist.playItem(itemid)

it should unload VLC, and then you can close your app
VLC & web IT consulting - http://www.revolunet.com
Github : http://github.com/revolunet

Hani123123
New Cone
New Cone
Posts: 9
Joined: 17 Feb 2009 16:33

Re: Quitting a VB form while VLC Runs crashes Vista x64 Ultimate

Postby Hani123123 » 19 Feb 2009 14:22

Thank you revolunet for your suggestion.
I have written the exact code line you told me. (except for the ";").

Same thing happens.

The Vista bluescreen indicates

STOP 0x0000003B SYSTEM_SERVICE_EXCEPTION
on win32k.sys

This happens only while using axvlc. If i insert a shockwave object, the form closes properly. What else should I try? :cry:
I also removed Me.Close from the line. And only running the vlc quit command does the same thing...

revolunet
Big Cone-huna
Big Cone-huna
Posts: 515
Joined: 17 Oct 2007 13:16
VLC version: 0.9.8
Operating System: Vista
Location: Paris, France
Contact:

Re: Quitting a VB form while VLC Runs crashes Vista x64 Ultimate

Postby revolunet » 19 Feb 2009 14:58

did you try also stop the playback before closing ?

vlc.playlist.stop()

check before closing that everything about VLC is stopped.
VLC & web IT consulting - http://www.revolunet.com
Github : http://github.com/revolunet

Hani123123
New Cone
New Cone
Posts: 9
Joined: 17 Feb 2009 16:33

Re: Quitting a VB form while VLC Runs crashes Vista x64 Ultimate

Postby Hani123123 » 19 Feb 2009 21:37

revolunet, the playlist.stop command didn't work either.. so I think I found a resolutoin:

I added a dialog box on the "EXIT" button of the application (the one that originally included the Me.Close command).
The code is:

Code: Select all

AxVLCPlugin21.playlist.items.clear() AxVLCPlugin21.playlist.add("vlc://quit") AxVLCPlugin21.playlist.play() Dialog1.Show()
So basically, when the user wants to exit the application while the Confirmation dialog pops up, the VLC Plugin seems to have enough time to teminate properly.
So when the user confirms he wants to exit the application, VLC is already closed by then. I still don't know why all this hussle... but hey, a confirmation dialog is not too bad, as I was eventually needed..

Thank you again for your support, and I wish you hundred of flawless code lines! :lol:
Hani - Romania

revolunet
Big Cone-huna
Big Cone-huna
Posts: 515
Joined: 17 Oct 2007 13:16
VLC version: 0.9.8
Operating System: Vista
Location: Paris, France
Contact:

Re: Quitting a VB form while VLC Runs crashes Vista x64 Ultimate

Postby revolunet » 20 Feb 2009 10:10

Hani,

be careful, the items.clear() doesnt seem to work for me on 0.9.6

thats why i use

Code: Select all

Dim itemid as integer = AxVLCPlugin21.playlist.add("vlc://quit") AxVLCPlugin21.playlist.playItem(itemid)
good luck
VLC & web IT consulting - http://www.revolunet.com
Github : http://github.com/revolunet

Hani123123
New Cone
New Cone
Posts: 9
Joined: 17 Feb 2009 16:33

Re: Quitting a VB form while VLC Runs crashes Vista x64 Ultimate

Postby Hani123123 » 20 Feb 2009 16:00

No luck mate. It seems that the workaround I tried fails, and the VLC plugin simply won't stop running.
I am thinking to kill the process when clicking OK in the dialog Box. I'll let you know how it goes.And yes, playlist.clear() doesn't seem to work for me either...

chad27295
Blank Cone
Blank Cone
Posts: 10
Joined: 28 Jan 2008 20:06

Re: Quitting a VB form while VLC Runs crashes Vista x64 Ultimate

Postby chad27295 » 23 Feb 2009 20:35

Just to note I'm having the exact same error on 2 very different PCs one with Vista 32 and the other is Vista 64.

chad27295
Blank Cone
Blank Cone
Posts: 10
Joined: 28 Jan 2008 20:06

Re: Quitting a VB form while VLC Runs crashes Vista x64 Ultimate

Postby chad27295 » 24 Feb 2009 16:06

Code: Select all

'Add a Timer to the form with an interval of 1000 or more and make sure its not enabled. Public Class Form1 Dim timercount = 0 Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click AxVLCPlugin21.playlist.add("udp://@239.255.1.15:5500") AxVLCPlugin21.playlist.play() End Sub Private Sub MyForm_Closing(ByVal sender As System.Object, ByVal e As _ System.ComponentModel.CancelEventArgs) Handles MyBase.Closing Try e.Cancel = True ' This will cancel the form from closing for now AxVLCPlugin21.playlist.items.clear() AxVLCPlugin21.playlist.add("vlc://quit") AxVLCPlugin21.playlist.play() Timer1.Enabled = True ' The timer will allow some seconds to pass and give the plugin time to quit. 1 second seems to work for me. Catch ee As Exception MsgBox("Can't close") 'Just in case something goes wrong. So far it hasn't failed End Try End Sub Private Sub Timer1_Tick_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick ' AxVLCPlugin21.Dispose() ' We could go further and remove the plugin alltogether but so far I don't think we need to Me.Dispose() ' If we just did a regular me.close here it would loop back to the form closing function and we wouldn't get anywhere. End Sub End Class
I was able to put a timer on my project to give the plugin time to quit before I closed the form. Thanks everyone for pointing me to the right direction on getting the plugin closed down first. I posted my complete code for everyone else that is still having a problem. Hopefully it will work for everyone.

Hani123123
New Cone
New Cone
Posts: 9
Joined: 17 Feb 2009 16:33

Re: Quitting a VB form while VLC Runs crashes Vista x64 Ultimate

Postby Hani123123 » 25 Feb 2009 14:36

Thank you very much chad27295 for sharing your timer code with us.
I took a different approach, tough. I disabled the controls of the form (so no Alt+F4, or X on the upper right is available anymore), and added a kill process function, so that it instantly kills the VB application, as soon as you hit the Close button.. Therefore, Me.Close() not needed anymore.
It's pretty rough and reckless, but works just perfectly! :)

If anyone needs the code, please let me know!!

Ali_2009
New Cone
New Cone
Posts: 1
Joined: 16 Mar 2009 09:58
VLC version: 0.9.8
Operating System: XP / XPe
Location: Islamabad

Re: *SOLVED* Quitting a VB form while VLC Runs crashes Vista x64

Postby Ali_2009 » 16 Mar 2009 10:39

@hani

me were making a project related to wireless communications:

Server (192.168.32.175) - will broadcast onboard cam's video stream through regular distributed VLC Software 0.9.6
CLIENT (192.168.32.75) will have VB VLC stream player like one which u developed + few added functionalities
CLIENT (192.168.32.76) will have VB VLC stream player like one which u developed + few added functionalities
CLIENT (192.168.32.77) will have VB VLC stream player like one which u developed + few added functionalities

plz mail me the VB 2008 - VLC Project you made at address:
ali.magsi@live.com

have to integrate axtiveX controls in an app connected to this VLC Client
earliest reply highly appreciated.
Thx


Return to “Web and scripting”

Who is online

Users browsing this forum: No registered users and 5 guests