Returning Features Active Forms

Some other features from the Delphi 7 times got back into Delphi 2009 after a long absence. One of them is the ActiveX Control Wizard (including Active Forms). Notice, though, that this wizard doesn't generate the proper HTML deployment files as it did in the past. Actually most of the COM-related wizards have been improved graphically (and partially in their feature set) for Delphi 2009, as you can see in the overview provided by Chris Bensen in his sneak peek blog post at:

http://chrisbensen.blogspot.com/2008/07/ tiburn-sneak-peek-com-wizards.html

As an example I've created a new ActiveX library, and added to it an Active Form (picking the icon of the ActiveX page of the New Items dialog box):

I've then added a standard About box, generated the Active Form, saved everything, and added a button to the Active Form button that displays some versions of the "What is Unicode?" sentence in different languages and alphabets in a Memo control.

Now I can compile and register the ActiveX Library, but how do I get the form to display in Internet Explorer? I opened up a very old Active Form project (a Delphi 5 project, to be precise), grabbed the HTML Delphi generated for it, and replaced the GUID in it with the CoClass GUID and the ActiveX library name with the current one: <htm1>

<object c1assid="clsid:AE64FD40-25c5-4697-Bl9C-8CE781695B71"

codebase= "./MyActiveForm_Project.ocx"

width=570

height=328

a1ign=center

At this point I can open the HTML file (in the same folder as the OCX library) with Internet Explorer, pass a couple of security warnings like:

Security Warning I™

Allowing active content such as script and ActiveX controls can be

! useful,

but active content might also harm your computer.

Are you sure you want to let this file run active content?

Yes ] [ No

and continue to the HTML page embedding the ActiveX form:

Building an ActiveForm in Delphi 2009 is an interesting exercise to bring back memories of a time Microsoft was trying to impose a proprietary and Windows only model to the web, a tentative initiative that utterly failed. But does it make any technical sense to use it now? As much as I disliked the unsafe ActiveX technology back them, and with all of the extra power (including more open client technologies) you have now at the browser level, I'd generally say no.

Still, there are specific in-house situations for which a simplified deployment would make things easier... or some not-so-smart customers for which a web application is good as it runs in the browser. In these niche situations, if you already have an investment in this technology, it might make sense to go for it... but the sooner you can move away from a vision of a Win32-only, Internet Explorer-only Internet, the better.

Was this article helpful?

0 0
Project Management Made Easy

Project Management Made Easy

What you need to know about… Project Management Made Easy! Project management consists of more than just a large building project and can encompass small projects as well. No matter what the size of your project, you need to have some sort of project management. How you manage your project has everything to do with its outcome.

Get My Free Ebook


Post a comment