• Welcome to Theos PowerBasic Museum 2017.

How to pass interface to VB Script (or other non-typed languages)

Started by Andrew Peacock, March 30, 2011, 02:54:01 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Andrew Peacock

Hi,

Is there any way to pass an interface from a PB COM DLL to VBscript? I'm trying to get a reference from the Mini Webbrowser example out of PB, and having problems.

Ideally, i'd like to do something like this in VBScript:

hwnd=123456
set obj = CreateObject("PBobj")
iweb2 = objA.getIWebBrowser2(hwnd)
title = iweb2.document.title     ' This is now calling the IHTMLDocument interface via the IWebBrowser2 interface
set obj = Nothing

I can do the hwnd->Iwebbrowser2 mapping, thanks to code you've posted elsewhere, Jose.
But I can't work out how to get the actual interface out to VBScript, in the same way as I would doing this:

Set ie = WScript.CreateObject("InternetExplorer.Application")
ie.navigate("http://www.bbc.co.uk")
title = ie.document.title


Any ideas?

Regards,
Andy

José Roca

 
Sorry, I can't help you with VBScript. I never have used that language.

Andrew Peacock

OK Jose, thanks for taking a look and responding, anyway.
Andy