Page 1 of 1

Loading a file with ActiveX control.

Posted: 09 Jan 2006 01:34
by tonsofpcs
Tried with both VB6 (98) and VB2005, error occurs on the equivilant line in both. The line is:

VLCP.addTarget(dialogOpen.FileName, opts, AXVLC.VLCPlaylistMode.VLCPlayListReplaceAndGo, n)

where n is [written directly in] 0 or -666 [as in the webpage sample]
and opts = "input-repeat=0" or ":input-repeat 0" (i have tried all combinations of n and opts listed herein).
The error in VB2005 is: "ArgumentException was unhandled": "Value does not fall within the expected range."
VB6/98 just gives "Run-time error '5':" - "Invalid procedure call or argument"

If this is how to load a file, does anyone know why I am receiving an error?
If this is not: does anyone know how to get the activex control to load a file?

Posted: 09 Jan 2006 11:12
by Quovodis
opts is not a string, but an array of string and you define it under VB as follow
Dim options() As Variant
options() = Array(":input-repeat=0")
VLCP.addTarget(dialogOpen.FileName, opts, AXVLC.VLCPlaylistMode.VLCPlayListReplaceAndGo, n)

Posted: 09 Jan 2006 17:31
by tonsofpcs
Thank you. I will try this.
Would you happen to know how this is done in VB 2005? (array is a type and cannot be used as a function...)

Posted: 09 Jan 2006 22:44
by tonsofpcs
Update: I tried it in VB6, Now it works [missed the () the first time i put it in :)], but when i load in videos that play properly in the stand-alone vlc, it just 'plays' black in the activex control...

Posted: 10 Jan 2006 11:14
by Quovodis
try turning off overlay rendering in the video options in the player, and save that as preferences.

Posted: 10 Mar 2006 22:20
by Jordan
I'm developing a quick front-end to VLC in Visual Basic 2005 Express Edition.

Code: Select all

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim path As String Dim options() As Object options() = Array(":input-repeat=0") OpenFileDialog1.ShowDialog() path = OpenFileDialog1.FileName Label1.Text = path 'load the file into VLC 'final.VLC.playlistClear() ' final.VLC.addTarget("G:\media_player\video.flv", 0, 2, 0) 'final.VLC.src() final.VLC.addTarget(path, options, AXVLC.VLCPlaylistMode.VLCPlayListReplaceAndGo, 0) End Sub
Error 1 Number of indices is less than the number of dimensions of the indexed array. C:\Documents and Settings\username\My Documents\Visual Studio 2005\Projects\video_experiment\video_experiment\Form1.vb 6 16 video_experiment


Error 2 'Array' is a type and cannot be used as an expression. C:\Documents and Settings\username\My Documents\Visual Studio 2005\Projects\video_experiment\video_experiment\Form1.vb 6 21 video_experiment