The program in this article is written by VC + +, slightly changes some, the program is written with C++builder.
An ActiveX control is a dynamic-link library that operates as a COM server and can be embedded in a package container host application, which is the predecessor of an OLE control. Because ActiveX controls are not related to the development platform, ActiveX controls developed in one programming language can be used in another programming language without any modification, as if using a Windows generic control. such as: in VC + + developed ActiveX control, no modification can be applied to VB. This shows that the use of ActiveX controls enables rapid and small component reuse, code sharing, thereby improving programming efficiency.
----ActiveX controls downloaded from the Internet, or ActiveX controls from other sources, what should users do to use them correctly? In general, a foreign ActiveX control must first be used correctly in Windows, and the control file (*. OCX) is copied to the hard disk and then registered in Windows, and ActiveX controls that are not registered in Windows are not available. There are generally three ways to register ActiveX controls, with different ranges of application, each with its own merits, discussed separately below.
First, use the Regsvr32.exe program to register ActiveX controls
----ActiveX controls that are unregistered can be registered with this software, and foreign ActiveX controls must be registered to apply to their programs. The file is located in the System subdirectory of the Windows directory. Use the following methods: Click "Start" → "run"; In the Run dialog box, enter the following command:
regsvr32 < filename > Registering an ActiveX control
regsvr32/u < filename > Remove the registration of an ActiveX control
----We use some applications with ActiveX controls, there are times when we may not be able to run a situation where the ActiveX control is not registered, and you might as well use the above command to try it.
Second, the use of installation procedures
Production software: InstallShield
It is not a good solution for an application to register an ActiveX control----using Regsvr32.exe, but it requires manual registration by the user and a manual cancellation when not in use. Large application software generally has a setup program, in the installer to resolve ActiveX control registration is an ideal solution. With InstallShield, you can create professional-level setup, register ActiveX controls, and automatically log off of previously registered ActiveX controls when you download software later. The method is as follows:
Start InstallShield, use Projectwizard to build a new project;
Create a new "FileGroup" to place the ActiveX control files that you want to register into this "FileGroup";
Set the Self-registered property of the above "FileGroup" to "Yes".
----The above steps are only a few steps to setting up autoenrollment ActiveX controls in Setup, and how to use InstallShield to make a complete setup is outside the scope of this article, please refer to the books yourself.