. .

tutorial

Using ActiveX Controls with VisualWorks

March 24, 2010 12:08:41.973

I thought a small walkthrough on using the new ActiveX control capabilities of VisualWorks 7.7 might be useful, so here goes - you can download the code I built in the screencaptures below here.

With that out of the way, here's how to build it yourself. First, load the ActiveX support - to do that, you need to open the parcel manager, and switch to the directories tab - then select "com":

Once that's in, open the GUI builder, and you should notice a new widget: the ActiveX widget. This functions (from a Smalltalk perspective) a lot like the subcanvas:

Once that's selected, add it to the canvas. In the properties tool, give it an aspect, and then pick (from the collection of items in the lower menu) the control you want. Your list will vary, based on what happens to be installed on Windows:

Now, add an input field (for the url you'll be loading) and a button (to do the load). It should look like this:

Install that to a class, and then use the "define" menu option to set up the method stubs. Now, go to a browser, and change the #load method (the one being used by the button) to look like this:

That's it for the hard stuff - now open the UI, and enter an URL for something that Quicktime can play:

You may have to wait a bit for it to buffer, depending on how fast your internet connection is (use a file url if you have a very slow one). If you use the link above, a short video from ESUG, of Gabriel Honore demonstrating his RetrObjects project, will play. That's it!

Technorati Tags: , , ,

posted by James Robertson

 Share Tweet This