<<

Khalil Rehman December 2, 2003

What is ActiveX: ® ActiveX™ is a set of technologies from Microsoft that enables interactive content for the . With ActiveX, Web sites come alive with multimedia effects, interactive objects, and sophisticated applications that create a user experience comparable to that of high-quality CD-ROM titles. ActiveX provides the glue that ties together a wide assortment of technology building blocks to enable these "active" Web sites. (Microsoft Corporation, July 1996)

What does ActiveX do?

It is designed to increase the dynamic designs of a website. The controls are components that can easily be inserted into a or other application to reuse packaged functionality someone else has programmed.

Benefits of ActiveX Some benefits of ActiveX are,

• Active web content which attracts the user and retain their interest in the web pages.

• Open cross platform support on , Windows and Unix operating systems

• The tools in which wants to build ActiveX controls are very common and familiar like , Visual ++®, Borland , Borland C++, Java™, and Java-enabled tools • Existing inventory of ActiveX controls available today for immediate use by Web producers

ActiveX VS Java ActiveX is a Microsoft platform dependent and works on window based machine and only work in the browser. Once ActiveX controls install and run on the machine it doesn’t need to install and run again, saving the download time after first use. Java has been developed to work on any kind of machine and and do not need of any kind of plug-in.

Some Examples of making ActiveX controls

Softwares Required:

Microsoft Front page, Visual Basic 6.0 and player 6.4

How to build ?

ActiveX controls that you build in Visual Basic (or any language, for that matter) are not only useful in development tools but also in end-user applications. For example, you can embed an ActiveX control created in Visual Basic in an HTML document that will be viewed in a Web browser such as Microsoft Internet Explorer. The application in which an ActiveX control is displayed is referred to as the control’s container. Visual Basic is the ActiveX control container used for most of the examples however, keep in mind that your control might be activated in containers other than Visual Basic.

Step 1: Open Visual Basic and click on the ActiveX Control icon

Step 2: Right click on the left tool bar and click on components. In the components window check on window media player and

Microsoft common dialogue 6.0 then click ok. You will find window media player and common dialogue button on the left toolbar.

Step 3: Double click on the window media player and common dialogue button to insert them in the dotted area. Drag and adjust it as you like.

Step 4: By double clicking in dotted area the code window will appear, write the following code

Dim str As String Private Sub Command1_Click() CommonDialog1.ShowOpen str = CommonDialog1.FileName If str <> "" Then WindowsMediaPlayer1.FileName = str WindowsMediaPlayer1.Play End If End Sub

Save it in the desired folder. You can run the program by clicking on the play button on the top tool bar

Step 5: Go to files and click on make project.ocx

Now the ActiveX control has been created

How to run ActiveX control over the internet:

Step 1: Create a .CAB( ) file

Click on Go to programs Go to 6.0 tools

Click on Package and Deployment Wizard

A new dialogue box will open. Browse where your project is and then click on the package icon.

On Package Type dialogue box click on the internet package option.

Follow the directions. Click yes when asked to create the package folder. In the File Source dialogue box check on Include in this cab and click next.

In safety setting dialogue box change safe for scripting and safe for initialization to yes from no.

Step 2: Package and deployment wizard will create an file and .cab file with the same name in the package folder. Upload the cabinet file along with html file from the package folder to your krypton or any other server you like.

If your current security prohobit running ActiveX controls in your MS .0 browser make sure that your Security Settings are not too restrictive to allow the download and installation of the ActiveX controls. Select Internet Options from the Tools menu and click on the Security tab. Here you will see that you can modify the security settings of two Web content zones (Internet and Local Intranet). This is so that you can allocate different settings to each zone. Setting the select box to “Low” and clicking on the Reset button in the Reset custom settings section will automatically set the settings to the appropriate level .Refresh the page again.

Questions and Answers

Short Questions

Q 1. What is ActiveX controls?

Ans. ActiveX Controls Reusable software components that incorporate ActiveX technology. These components can be used to add specialized functionality, such as animation or pop- up menus, to Web pages, desktop applications, and software development tools. ActiveX Controls can be written in a variety of programming languages, including C, C++, Visual Basic, and Java.

Q 2. The difference between ActiveX and Java?

Ans. ActiveX is Microsoft plateform dependent and Java is not dependent to any operating system.

Q 3. What are the three benefits of ActiveX?

The three benefits of ActiveX are as follows,

• Ans. Active web content which attracts the user and retain their interest in the web pages.

• Open cross platform support on Macintosh, Windows and Unix operating systems

• Existing inventory of ActiveX controls available today for immediate use by Web producers

Q 4. What is the difference between ActiveX and and ActiveX controls?

Ans. An ActiveX component is just a general term, encompassing:

• An ActiveX EXE • An ActiveX DLL • An ActiveX Control

An ActiveX component is not:

• Active, in any way, shape or form • A source of fibre that can help you lose weight as part of a calorie controlled diet

Q5. What are the four core technologies of ActiveX ?

Ans. The four core technologies of ActiveX are,

ActiveX Controls

ActiveX Scripting

ActiveX Documents

ActiveX Server Framework

True False

Q1. ActiveX controls are same as Java Applets

Ans. False

Q2. After their first oinitialization ActiveX controls do not need to download again and therefore take less time to execute.

Ans. True

Q3. Existing inventory of ActiveX controls available today for immediate use by Web producers.

Ans. True

Q4. Java Virtual Machine is the code that enables any ActiveX-supported browser such as .0 to run Java applets and to integrate Java applets with ActiveX controls.

Ans. True

Q5. ActiveX is currently supported on the any operating system.

Ans. True

Multiple Choice Questions

Q1. The ActiveX controls run over the internet by creating a ______file.

a)exe b) cab c) doc d) jpeg

(Ans is b)

Q2. The tools in which programmer wants to build ActiveX controls is a) Visual Basic b) Visual C++® c) Borland Delphi d) All of the above

(Ans is d )

Q3. ActiveX control is ______platform dependent.

a) Linux b) Microsoft c) Macantoch

(Ans is b)

Q4. ActiveX are designed to ______the dynamic designs of a website.

a) Decrease b)alter c)Increase d) None of the above

(Ans is c)

Q5. One of the choice is not the core technologies of ActiveX.

a) ActiveX HTML b) ActiveX Scripting c)ActiveX Documents

d)ActiveX Server Framework

(Ans is a )