Embedding OLE - Internet Explorer browser

VA Smalltalk is a "100% VisualAge compatible" IDE that includes the original VisualAge technology and the popular VA Assist and WidgetKit add-ons.

Moderators: Eric Clayberg, wembley, tc, Diane Engles, solveig

Embedding OLE - Internet Explorer browser

Postby Livardo » Fri Oct 02, 2009 9:03 am

Hi all,

I'm trying to embed Internet Explorer into a visual part. I followed the instructions about loading the OLE feature, and inserting a "OLE Control" directly in my view. I then change the client name to "Shell.Explorer.2". In the LocationURL I enter "http://www.yahoo.com" and launch the form, but nothing happens.

Can anyone clue me in as to what to do next?

I also looked at the OLE generator, but I'm not sure what to do after it generates my "OLE View". How do I get the window to embed and show up on the form?

Thanks in advance!
Livardo
 
Posts: 27
Joined: Thu Nov 01, 2007 6:33 am

Re: Embedding OLE - Internet Explorer browser

Postby marten » Fri Oct 02, 2009 12:10 pm

Use the generator to create a "view" for Shell.Explorer.2 and then add this control to a normal VA form. Then connect the widget opened event of that form to the navigate-method of the control and set the url parameter to something you would like to see. You could also use the Firefox Active-X control to get the same results ...

Just some early steps to get fast success ....

Marten
Marten Feldtmann, Principal Smalltalk User, Private
SkypeMe callto://marten.feldtmann
marten
[|]
 
Posts: 641
Joined: Sat Oct 14, 2006 7:10 am
Location: Hamburg - Germany

Re: Embedding OLE - Internet Explorer browser

Postby Livardo » Sat Oct 03, 2009 10:08 am

marten wrote:Use the generator to create a "view" for Shell.Explorer.2 and then add this control to a normal VA form. Then connect the widget opened event of that form to the navigate-method of the control and set the url parameter to something you would like to see. You could also use the Firefox Active-X control to get the same results ...

Just some early steps to get fast success ....

Marten



Thanks for the reply. I finally figured it out.

1. By view, they mean, a subclass of AbtOleControlView.
2. I subclassed #1 first and then told the Generator to generate code to my AbtOleIEView class.
3. I followed the example they included. They create an OLE Object wrapper, and so I did the same.
4. I created a normal view-part and added the AbtOleControlView part to the form.
voila!

Basically, the reason I'm trying to do this is so we make use of the fancy HTML/Javascript calendars available outthere. I'll have to execute some javascript and inspect the results of the script in my Smalltalk code.

I really love figuring this stuff out but with Smalltalk it's always such an expedition! The documentation says "just load the samples", but it'd be nice to know how they put the samples together.

I figured out how to set variables via Javascript and read them back in Smalltalk. Simple values are passed as-is, but objects are passed back as OLEAutomationObjects.

Example (for posterity)

Code: Select all
|date month day year |

(self document propertyAt: 'parentWindow') invoke: 'execScript' withArguments: #('myDate = new Date').
date := (self document propertyAt: 'parentWindow') propertyAt: 'myDate'.
month := date invoke: 'getMonth' withArguments: nil.
day := date invoke: 'getDate' withArguments: nil.
year := date invoke: 'getYear' withArguments: nil.
Transcript show: ((month+1) asInteger printString, '/', day asInteger printString, '/', year asInteger printString) .
Livardo
 
Posts: 27
Joined: Thu Nov 01, 2007 6:33 am

Re: Embedding OLE - Internet Explorer browser

Postby tc » Mon Oct 05, 2009 12:22 pm

Hello,

It can be done either way, drop an OLE control part on a window in the composition editor and set the name or generate the OLE class from the VA window.

I personally prefer the composition editor part approach since it seems a little cleaner, only the things I'm using are there, not all possible methods (read out of the type library).

--tc
tc
Moderator
 
Posts: 304
Joined: Tue Oct 17, 2006 7:40 am
Location: Raleigh, NC


Return to VA Smalltalk 7.0, 7.5 & 8.0

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest