Have a VB Script call a PB function - COMatePLUS

Share your advanced PureBasic knowledge/code with the community.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Have a VB Script call a PB function - COMatePLUS

Post by srod »

Hi,

I thought this might be of some use to others. :)

Please see the following thread for the discussion resulting in this code : http://www.purebasic.fr/english/viewtop ... 13&t=58200

Basically, there are examples in these forums of Javascript calling PB functions; but these are instances where the Javascript is running in a web gadget or IE.

What we have here is a similar thing, but with VB Script, and running in the MS Script Control (present on 32-bit versions of Windows) as opposed to a browser etc.

Please download the latest version of COMatePLUS for the demo and a little include file which contains a helper function. Basically, to have a VB script (running in the MSScriptControl) call a PB function, you have to create a COM object and feed this to the script control. This is how you extend the features of VB script. The COM object is the liason between the script and your PB program. The aforementioned include file wraps up all the code (and there's not much of it) dealing with the creation of the COM object.

Regards.
I may look like a mule, but I'm not a complete ass.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: Have a VB Script call a PB function - COMatePLUS

Post by srod »

Whoops... slight memory leak plugged and fixed. :)
I may look like a mule, but I'm not a complete ass.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Have a VB Script call a PB function - COMatePLUS

Post by Kwai chang caine »

After 8 years of hard works ...i can understand (With of sure, numerous thinking :oops: ) your trick, without ask stupid question :D
And even understand, what is the utility of your new code :shock: :wink:
COMATE is for me, really the best thing created by the community 8)
I have use it numerous time there are some years ago...and each time i use it, i'm always surprising by his power :shock: 8)

Thanks to you, i can quit more often this #~*¤$@ of VB6 :? and works with love PB :D
So thanks for sharing and support this project since all this several years 8) 8) 8) 8)
ImageThe happiness is a road...
Not a destination
Post Reply