Page 1 of 1

ActiveX, VB6, GetVariable

Posted: 10 Oct 2005 12:35
by dh1nfj
hello,

i'm using the activex.dll with vb6. i've tried to use the getvariable functions, but I can't get them to work. vlc_h = VLC.getVariable("height") courses an memory overflow error. can someone post me an example of using the get- und setvariable functions with vb6? is there a list auf variable which i can set und get? I'd like to check if the player is in fullscreen-mode oder no.

thanks, jochen

ps: i'm using vlc 0.84 beta

ActiveX, VB6, GetVariable

Posted: 10 Oct 2005 15:47
by Pflaume
Hey,
you are getting a "Out of Memory" because the ActiveX is exepting a Codepage (_p_instance->getCodePage();). While you are using the ActiveX in VB / .Net, there is no Codepage available.

You have to change the Sourcecode to get it running.
I have tried it, but it is still not running.

For ex. (In VB6):

Dim val As Integer
val = VLC.getVariable("key-vol-mute")
VLC.setVariable "key-pressed", val

I get val = 109 and when I use setVariable, nothing happens...

Any Idea?

Regards
Stefan

Posted: 11 Oct 2005 17:18
by Quovodis
the "OUT OF MEMORY" error has been fixed in the repository, thanks for the report

OUT OF MEMORY

Posted: 11 Oct 2005 18:02
by Pflaume
Quovodis:

Hey,
thank you for Fixing the Bug. When is the new svn available?

I have tried it by my own, but there are still a Problem with the setVariable.

Maybe you could help me.

1) I read out the Key for "key-audio-track"
X = VLC.getVariable("key-audio-track")

2) I should get "109" as Variant/Integer

3) I send the "109" with:
VLC.setVariable "key-pressed", X

4) Nothing happens...

From the Source Code I can see, that the "setVariable" should find the Type of Variable (eg. Integer) by it's own... But I dont know, how the "key-pressed" in VLC is working.

When I set the VLC.setVariable "key-audio-track", 109 the new Value of "key-audio-track" is allways "2", no metter witch Value I try to set. After that, I can access the key-audio-track with VLC.setVariable "key-pressed", 2
Maybe, there is a Problem with the:
VariantChangeType(&value, &arg, 0, VT_I4); ?

I you have any further Information, please let me know.

In the Moment, I am writing a App. that holds the VLC as an ActiveX and is downloading Playlists etc. from a VOD Server (VLS, VLC, ASP, SQL).
The Client- App has full Remote Control support! (Yes, IR Remote Control).
The Goal is a Windows XP embedded Application for an embedded STB to Watch DVD and Streams from the VOD Server. (Next Step is a Linux embedded STB (Sorry, but let me Start with MS first, I am a MS VB, VC .NET prof.))

Of Cours, it is open Source... A Sourceforge Project will be setup soon.

So, I can do a lot of debugging and reporting bugs for the activeX VLC plugin, if you are interestet.
Also I am working on putting the hole ActiveX into a VC Workspace. After that, it should be easy to implement a 100% compatible MFC/ATL table that can later be used under Cygwin to compile.

Please let me Know what you are thinking about it!

Regards
Stefan

P.S.: I am using VLC for several Years now and I think it is very, very good Work!

Posted: 11 Oct 2005 18:55
by Quovodis
Stefan,

you were right, the arguments for VariantChangeType were inverted, I have restored them in the right order.

VLC.setVariable "key-pressed", X

now works properly in Visual Basic.

the fix will be available in 0.8.4-test2, but if you like to live on the edge, you can grab the next nightly build @

http://nightlies.videolan.org

or use subversion to grab the latest source code, check out the developer page for more info

thanks for your help and good luck for your project, and don't forget to log those bugs

Damien

Thank You

Posted: 11 Oct 2005 19:11
by Pflaume
Hey Damien,
I already use svn, so, I will compile the new svn release soon.
Thank You for Fixing the Bug.

I would be a great help to have a "ActiveX" chapter in the Bugzilla of VLC!
Could you do that?

I will send you further things, when I find something strange...

Thank you & Regards

Stefan

Posted: 13 Oct 2005 09:48
by dh1nfj
hello,

i've downloaded the newest version of vlc and it works fine!

thanks!

Posted: 13 Jan 2006 00:36
by AtomicWaste
I want to toggle directx overlay while playing a video file (or while it's in pause mode) and thought setvariable should be the right way to do it (if you can do it at all while directx is initialised).

I'm using VB6 and

Code: Select all

val = vlc.getVariable("key-audio-track") vlc.setVariable "key-pressed", val
works fine, but which variables are there at all that can be modified by setvariable?

Posted: 13 Jan 2006 05:05
by tonsofpcs
Well, I've been working on this (you can find me in the IRC channel alot now-adays), and so far I have:
  • verbose
    key-pressed
    drawable
    drawableredraw
    drawablet
    drawablel
    drawableb
    drawabler
    drawablex
    drawabley
    drawablew
    drawableh
    drawableportx
    drawableporty
    volume-change
    open
Also, note that I have tested a good portion of the variables in this list, and those are the only ones that don't throw errors so far, note that I am currently testing *WITHOUT* any video playing in the player.
(looks like only src/libvlc.c variables)

Posted: 13 Jan 2006 05:54
by tonsofpcs
Update: It also seems that the 'config' names from /doc/lirc/example.lircrc work too

Posted: 17 Jan 2006 01:06
by tonsofpcs
Update: Documenting the ActiveX control on the wiki at http://wiki.videolan.org/index.php/ActiveX. Feel free to have a peek.