What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [?] VLC API

[?] VLC API
Author: Message:
J-Thread
Full Member
***

Avatar

Posts: 467
Reputation: 8
– / Male / –
Joined: Jul 2004
RE: [?] VLC API
That's C# and not C! Ok, it's of course no coincidence that the language was named C#, but it actually is different;).

As far as I can see it will not be very hard to translate this. I have not tested this, but it should be something like:

code:
var DllPath = "libvlc.dll"; // the full path to your dll

function VLC_Create() {
   return Interop.Call(DllPath, "VLC_Create"); // Interop expects an int
}

function VLC_TimeSet(/*int*/ iVLC, /*int*/ Seconds, /*bool*/ Relative) {
   return Interop.Call(DllPath, "VLC_TimeSet", iVLC, Seconds, (Relative?1:0));
}

// [...]



This way you should be able to create wrapper functions for all functions in the dll. Some points to notice:
ints (or Numbers in JScript) can be passed directly through interop.call
ref ints can be passed by assigning a 4 bytes databloc, use WriteDWORD to write the number on position 0 and then pass the datablocs pointer. After the function returns, you can read the int again.
bool's should be casted to 0 (=false) or 1 (=true)
strings can be passed directly, plus automatically passes the pointer
I'm not sure about the string array, maybe you can pass it directly, else you will have to use a databloc of size (total characters in the array strings) + (number of strings * 2).
Error, Mode and Pos can be seen as an int, just use the values described in their enums.
The structure will be the only hard part, use a databloc for that. Add the sizes and write the types to the right part of the bloc. I don't know the sizes of the types by heart, so can't give you those now, maybe I can help with that later, or maybe (I hope so) you can figure it out yourself. Int32 means 32 bits = 4 bytes, so Int64 = 8 bytes, not sure about the rest:P

Anybody correct me if I am wrong here, this is it in a nuttshell, I am doing this all right out of my head (I am not sure if that is correct english, but at least the dutchies will get what I say there :P) so there might be some mistakes. It should at least point you in the right direction!

This post was edited on 12-25-2006 at 11:48 PM by J-Thread.
12-25-2006 11:47 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[?] VLC API - by Spunky on 12-25-2006 at 01:27 AM
RE: [?] VLC API - by -dt- on 12-25-2006 at 02:11 AM
RE: [?] VLC API - by matty on 12-25-2006 at 02:11 AM
RE: [?] VLC API - by J-Thread on 12-25-2006 at 12:11 PM
RE: [?] VLC API - by Spunky on 12-25-2006 at 01:13 PM
RE: [?] VLC API - by J-Thread on 12-25-2006 at 11:47 PM
RE: [?] VLC API - by Spunky on 12-26-2006 at 02:22 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On