Key words: ActiveX, Internet, HTML, Web, OLE technology, control, and objects This article combines the development trend of the current Internet (Web) technology, brief introduction to the content of ActiveX technology proposed by Microsoft, elaborating ActiveX Technology and Web Site Construction and Desktop Programs The relationship of development, as well as the steps and methods of developing ActiveX components using Visual C and Visual Basic, and gives examples of using ActiveX components in a web page. 1. ActiveX Overview 1.1. ActiveX definition ActiveX is a set of technical sets that Microsoft proposed using COM (Component Object Model, Parts Object Model) makes software components interact in network environments. It doesn't matter with specific programming languages. As a technique for Internet application development, ActiveX is widely used in various aspects of the web server as well as clients. At the same time, ActiveX technology is also used to easily create a normal desktop application. 1.2. Content ActiveX includes both server-side technology and client technology. Its main content is: * ActiveX Control; inserts a COM object to the web page, Microsoft Word, etc., which supports ActiveX's container (Container). * ActiveX Document; used to browse the composite document (non-HTML document) in the Web Browser or other container that supports ActiveX, such as Microsoft Word documents, Microsoft Excel documents, or user-defined documents. * ActiveX script description; manipulated ActiveX control and Java programs from the client or server side, delivering data, coordinating the operations between them. * ActiveX Server Framework; provides a range of functions for the design of Web server applications and packages, such as server filters, HTML data stream controls. * In Internet Explorer, the Java Virtual Machine is built-in, allowing the Java Applet to run on Internet Explorer and can communicate with the ActiveX control through script description language. 1.3. ActiveX and Java Comparison ActiveX provides a mechanism for extending any programming languages, including Java, Java developers can use ActiveX technology in Applet, directly embed ActiveX control, or use ActiveX technology as a bridge, will other Multi-language program objects provided by developers are integrated into Java. ActiveX provides "Code Signing" to ensure that its security is guaranteed compared to Java's bytecode technology. 1.4. Internet Explorer and Netscape Navigator are self-evident, Microsoft Internet Explorer fully supports ActiveX.
At the same time, Microsoft provides a PLUG-IN to Netscape Navigator, allowing Navigator to browse the Web site that contains ActiveX components. 2. ActiveX Control and Internet ActiveX Control are updated by OLE control. Control is the main element of establishing programmable components. ActiveX control can be used in a container that supports COM specification, or is embedded in the web page as an Internet. When the user accesses the page, the control is downloaded and automatically registered locally. Using the Script Description Language (Script) can communicate between control between control and between the client and the server, the Call method (Method), and an Alive event (Event). ActiveX control has fewer interfaces compared to previous OLE control, and there is no window. All ActiveX controls support iUnknown interfaces. At present, many third-party developers have developed a wide range of ActiveX controls. On the Internet, there are more than 1000 ActiveX controls for users to download. In Windows's System Directory, save ActiveX control provided by WINDOW. Microsoft Visual C (hereinafter referred to as VC) control is ActiveX control. Considering the current relatively low transmission rate, you must consider the following issues: * Control is as small as possible; * Continuous storage data is saved; * How to download on the Internet And installation; * Control how to register on clients; 3. ActiveX documentation and Internet ActiveX documents provide a traditional embedded object extension method. The ActiveX document object can contain multiple pages, displayed in the entire client area and support the original menu features. Unlike previous embedded objects, ActiveX document objects are no longer surrounded by a shaded frame, but a full frame (Full frame) and is always in the active state. Microsoft Office97 provides Microsoft Office Binder to generate and browse the composite document that makes up by Microsoft Word, Microsoft Excel, or user-defined ActiveX document, and each document type can be directly edited. ActiveX documents can be embedded as an object into a web page, published on the web. 4. ActiveX Script Description Language Use VBScript or Microsoft JScript, you can add ActiveX control that can be used to interact with the web page, put the data pre-processing or verification process on the client, and then pass the result to the web server. 5. ActiveX Server Framework Create an extended application on the web server, dynamically generate web pages. The ISAPI class supplied with MFC can easily establish an extended application of the web server side.
6. Visual C 5.0 provides a complete solution for Internet development for Internet development, which is: * Develop ActiveX control and ActiveX documents using MFC or ATL. * Use the ISAPI to design the part of the web server side. * Develop applications that use Wininet to access files over the Internet. * Use Asynchronous Monikers to generate applications that download data from Internet. * Develop other types of Internet-based Win32 applications using ActiveX SDK, including ActiveX Scripting Host, Microsoft WebConferencing, and more. 6.1. Develop ActiveX Control VC 5.0 with VC5.0 provides two ways to develop ActiveX control: MFC and ATL (Active Template Library). With MFC, you can pay attention to the details of the interface, focusing on the power of the control itself, but the generated control is relatively large. Moreover, if the client wants to run this ActiveX control, you must have a DLL of the corresponding version of the MFC class library. Small, but developers must understand the details of COM, OLE technology. In most cases, ActiveX control can be developed using MFC, which is more convenient. Moreover, since Internet Explorer 3.0 provides the class library of the MFC 4.1, Internet Explorer 3.0 is the component provided by Windows 95, so as long as ActiveX control is MFC 4.1 or earlier version, there is no need to download the MFC class library. . Using MFC development ActiveX control, you can generate engineering frameworks with MFC ActiveX Control Wizard. The VC will automatically generate three classes: (assuming myName is the name of the control.) * CMYNAMEApp: Derive from class ColeControlModule, and class ColecontrolModule is sent from cwinapp; * CMYNAMECTRL: Delate from class ColeControl, and class ColeControl is sent from CWnd; * CMYNAMEPROPPAGE: Deleted from class ColePropertyPage, and class ColeProppage is sent from CDIALOG; it can be seen that this framework is similar to a general MFC application. Most of the developers are in CMYNAMECTRL, such as using Class Wizard to add attributes, methods, and events, processing display, etc. After compiling the OCX file, use the ActiveX Test Container provided by VC to test this control, or use the OLE / COM Object Viewer to browse this control interface information and type library. 6.2. ActiveX Controls Applications on the Web Consider the security of the Web, in order to establish a good trust relationship with the client, you must set up a "code sign" on the Web on the Web. VC5.0 provides tools for generating "code signature" for testing. If you want to be officially released, you must apply to the relevant agency.
(See http://www.microsoft.com/intdev/signcode/) Use ActiveX control in the web page, and pack it, compress the relevant dynamic connection library and information files to an extension called CAB (Cabinet ). You can package ActiveX control using the tool package provided by VC5.0. In the HTML file, use the Object tag into ActiveX control and use VBScript or JScript to access the ActiveX control. When you use Internet Explorer to browse this page, you can automatically unpack this file. For security, Internet Explorer is the download, initialization of the ActiveX component, whether it has a legal code signature and whether Scripting is allowed to set different security levels, and the user can set as needed. In this example, ActiveX control "Mschart.ocx" is used. When this control is clicked with a mouse, the title will change.