ActiveX Document Technology
This page provides questions and answers and tips and tricks on using ActiveX documents.
The easiest way to describe an ActiveX document is to call it a Visual Basic form that appears within a browser. Though not technically accurate - it does allow you to picture what is going on with ActiveX documents.
To be more technically accurate, an ActiveX document is a structured storage file that is displayed by an ActiveX component. The structured storage file is the VBD file you may have heard about and the ActiveX component is the ActiveX Document EXE or ActiveX Document DLL that you build when you define the ActiveX document project.
ActiveX Document EXE and DLL components cannot be tested in the VBIDE. That is because just as an ActiveX control must be on a control container to be tested, an ActiveX document must be displayed in an ActiveX document container to be tested. Two such ActiveX document containers are Internet Explorer (IE) 3.0 and the Office Binder (part of Office '97).
Creating forms in VB is sooo easy. Just put controls on forms and add a little code for validation or control processing and you have a nice little user interface. Wouldn't it be nice if you could display that VB form right in a Web browser such as IE3.0? With ActiveX documents you can.
So if you have a completed VB project and want to move it quickly to the Web or if you want to leverage your VB skills but move to Web development - ActiveX documents are the way to go.
The easiest way to create an ActiveX document is using the ActiveX document Migration Wizard. This Wizard will convert existing VB forms to ActiveX documents.
For those of you with a UNIX Internet Service Provider (ISP), don't fear! It works! We currently have a UNIX ISP and have set up some ActiveX document.
For a simple example of an ActiveX document displayed from a UNIX ISP, click here.
So, how did we do it? The trick is to do the following:
Why does this work? Because by default many UNIX systems are set up to download files as Text unless explicitly identified to be a different type. So the vbd files are being downloaded as text files instead of as binary files. By changing the extension, you trick the UNIX system into downloading it as binary.
If you have control over the UNIX system, you can alternatively change the explict type definition. You do this by editing the mimi.types file to be something like text/vbd bin. (Thanks to Floyd Stewart from Cyber Web Productions, http://www.cyber-webs.com, for this information.)
To display an ActiveX document, you need an ActiveX document container. You can use existing containers such as Internet Explorer or Microsoft Binder or you can build your own. But how to you create an ActiveX document container in VB?
It is easy! Here are the instructions:
Private Sub Form_Load()
WebBrowser1.Navigate "http:\\www.insteptech.com\Team1.HTM"
End Sub
This will display my ActiveX document.
NOTE: Because our ISP is UNIX, the upper/lower casing of the URL must be exactly as shown in the code above.
| All contents © 2004 InStep Technologies, Inc. All rights reserved. |