Page 1 of 1

Have a VB Script call a PB function - COMatePLUS

Posted: Wed Feb 05, 2014 10:57 pm
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.

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

Posted: Thu Feb 06, 2014 9:34 am
by srod
Whoops... slight memory leak plugged and fixed. :)

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

Posted: Mon Feb 10, 2014 10:37 am
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)