Page 1 of 1

Activex, vbs, javascript, perl and more from PB very soon!

Posted: Fri May 09, 2003 7:23 pm
by ricardo
Hi,

Im almost finishing a package that let me call Activex, vbs, javascript, perl and more from PB from an easy dll.
Im thinking on release it as shareware for PureBasic users (very cheap for community members!).

With this dll we could be able to:

-Manage almost any ActiveX (COM) even receiving events from it (it was veeeery hard to find a workaround to achieve it!!). Per example i have a n example that let me run IExplorer and access the webpage and change/modify/spy it on run time.

-Use it an as runtime parser that has complete access to languages as vbs, javascript, perlscript, etc.

I want to know if someone is interested on this.

However i will finish it since im very interested even if no one else is interested.

The idea that COM are bloated is not the correct approach to this matter in IMHO. The situation is:

WIN 32 API let us manage a lot of things in a very nice way but windows has a lot of major features that relies in another layer called COM. If we want to have access to all this stuff (the explorer and internet explorer per example) the ONLY way is using COM. At least dosent hurts to have this possibilitie.

Now, since im not a ASM genious like Danilo, El_Choni, etc. I approach the problem by the other side, accessing to COM from itself using a small C++ dll and then giving PureBasic (in fact any language that support calling a dll) the door open to go inside the COM world.

Give me 3 or 4 days and i will be here with some running examples.

Posted: Fri May 09, 2003 7:58 pm
by Justin
Very interesting , looking forward to it.

Posted: Fri May 09, 2003 8:12 pm
by Cor
@Ricardo,

Thanks for your efforts

Can't wait to test it

Posted: Fri May 09, 2003 10:05 pm
by Mr Skunk
Have to see how your examples work, but this might be very interesting.

Posted: Fri May 09, 2003 10:52 pm
by ricardo
Mr Skunk wrote:Have to see how your examples work, but this might be very interesting.
Just letting you really run vbs, javascript, etc. directly from PB then you can manage all COM and (a very important thing) receive the events of the COM objects.

The syntaxis is the one of the language that you use for it, in javascript you call the COM in this way:

Code: Select all

var ExcelSheet;
// Call ActiveXObject: Excel
ExcelApp = new ActiveXObject("Excel.Application");
ExcelSheet = new ActiveXObject("Excel.Sheet");
// Make Excel visible through the Application object.
ExcelSheet.Application.Visible = true;
// Place some text in the first cell of the sheet.
ExcelSheet.ActiveSheet.Cells(1,1).Value = "This is column A, row 1";
// Save the sheet.
ExcelSheet.SaveAs("C:\\TEST.XLS");
// Close Excel with the Quit method on the Application object.
ExcelSheet.Application.Quit();
Very easy way to control EXCEL !!

Now it can be done within PB just with a dll of something line 100 kbs.

Usin vbs you can control IExplorer with some code like this one:

Code: Select all

Set myIE = WScript.CreateObject("InternetExplorer.Application")
myIE.Navigate "www.google.com"
myIE.Width = 600
myIE.Height = 600
myIE.Left = 150
myIE.Top = 0
myIE.Visible = True
And if you want to change the size of the font once the page is loaded (and dont need to reload with this method) jus add this sub and call it when you want:

Code: Select all

Sub ChangeFontSize(Num)
myIE.ExecWB OLECMDID_ZOOM, OLECMDEXECOPT_DONTPROMPTUSER,clng(Num)
End Sub
Of course you can extend all this stuff as you want. You can use Perl too...
The idea is to be able to call somelanguages in runtime calling just some small dll 'wrapper'.

Why does we need the dll? Because if you write the code to a flie and try to run it...

1.- You can get a Antivirus prompt
2.- You wont be able to cll different functions/sub when you want it. By runing a .vbs file you need to run ALL the script at onve. With the dll you can load the script and trigger every sub/function (even passign/receiving parameters) in runtime.
3.- You wont be able to catch COM events on your PB application. In this case you can control Excel or IExplorer or any other COM and get the events, per example you can know if using IExplorer when the page is downloaded or the percent of a download, etc.

*I know that maybe some guys don't want to use vbs, jvs, perl, etc. But for the moment we don't have any other choice to call COM in realtime in a easy way.
The dll will be just ~100/150 kbs. And of course, its not an obligation to use it :wink:

Re: Activex, vbs, javascript, perl and more from PB very soo

Posted: Sat May 10, 2003 12:23 am
by PB
> I want to know if someone is interested on this.

I'm definitely interested in ActiveX support because I own a couple of OCX
files from my Visual Basic days, and would love to use them with PureBasic.

Posted: Sun May 11, 2003 7:06 am
by ^OO^
I want to know if someone is interested on this.
I am intensely interested in the possibility of reading output from com objects like WSH parser output!

More strength to you, Friend :D

Posted: Sun May 11, 2003 7:21 am
by HPW
Yes, very interesting , I am also interested!

Posted: Sun May 11, 2003 7:37 am
by kns
Sounds good. From your example it would be painless to rewrite my python URL tracker (see viewtopic.php?t=5939).

kns

Posted: Wed May 14, 2003 3:06 pm
by Tranquil
I'm intrested too!

Posted: Fri May 16, 2003 11:36 am
by Mike
I'm also interested (special for control of excel)
cheers

Posted: Fri May 16, 2003 7:51 pm
by ricardo
Mike wrote:I'm also interested (special for control of excel)
cheers
Im almost done...

Posted: Fri May 16, 2003 9:22 pm
by Max.
ricardo wrote: Im almost done...
Excellent. :D

Posted: Sat May 17, 2003 5:55 pm
by Bernard
I'm intrested too