Page 1 of 1

Use Activex with Visual studio 2003

Posted: 13 Jan 2006 22:57
by Guest
Hello,
I load the vlc activex and the simples command without parameter like play() work. But the addTarget command return an error from the activex :

Code: Select all

addTarget("rtsp://mafreebox.freebox.fr/freeboxtv/201", "", 12, -666);
Have you an idea ?
Thanks

Posted: 14 Jan 2006 02:32
by Guest
I used VS Express 2005 for the exact same thing (freebox powaaaaa!) like this :
Player.addTarget(url, null, AXVLC.VLCPlaylistMode.VLCPlayListInsertAndGo, 0);

Worked like a charm ;-)

Posted: 14 Jan 2006 22:20
by jlbrd
This code :

Code: Select all

char url[] = "rtsp://mafreebox.freebox.fr/freeboxtv/201"; ax->addTarget(url, 0, VLCPlayListAppendAndGo, 0);
return on visual studio 2003 output :

Code: Select all

Error calling IDispatch member addTarget: Exception thrown by server.
and

Code: Select all

int i = ax->PlaylistCount();
return 0.

I don't understand where is the problem !

Posted: 16 Jan 2006 15:11
by MRTrevorF
I use Visual Studio.NET 2003 (VB), and this is what I use to play a local file:

Code: Select all

movMain.addTarget(targetPath, Nothing, AXVLC.VLCPlaylistMode.VLCPlayListReplaceAndGo, -666)
Null didn't work for me, I had to use the keyword Nothing... I don't know if this helps in your situation or not.

Posted: 17 Jan 2006 01:11
by tonsofpcs
I'm starting to document the ActiveX control here: http://wiki.videolan.org/index.php/ActiveX

Also, the options section should be an empty char if you don't want to send any options, not a 0. I haven't tried with VB.Net or VB 2005, but I do remember an issue with the way the two handle 'null', try using a 'null' value in the proper type (like "" for a null string, or 0 for a null integer). I think part of the problem might be your use of 12 (AppendAndGo), it may be that the control doesn't like appending to an empty playlist.