Installing the OCX control in Delphi

Source: Internet
Author: User

Step 1:

Anyone who has used ActiveX knows that ActiveX cannot be recognized and used by the system if it is not registered. Generally, the installer automatically registers the ActiveX control it uses, but what if you need to manually register a widget? If you modify the registration table, it will be too annoying. There is a regsvr32.exe program under the systemfile folder of windows, which is the built-in ActiveX registration and anti-registration tool for Windows. Its usage is: regsver32
Regsvr32 [/S] [/n] [/I (: using line)] dllname
The dllname is the ActiveX control file name. We recommend that you copy it to the system folder before installation. The parameter has the following meanings:/u -- anti-register control/s -- whether the registration is successful or not, no prompt box/c -- console output/I -- skip the control option for installation (different from registration)/n -- do not register the control, this option must be used with the/I option. For example, I want to register an amovie. OCX control, enter regsvr32 amovie. OCX, you only need to use regsvr32/u amovie to register it. OCX is enough.
Regsvr32/s apiinex. DLL registers the DLL file regsvr32/S/u apiinex. DLL uninstall DLL file regsvr32 uninstall cut. OCX registers the ocx file regsvr32/u named cut. OCX uninstall ocx file/s. DLL ,. after successful OCX registration, no prompt is displayed. /U. dll,. ocx uninstall Step 2:

Delphi-> component-> Import ActiveX-> Find the registered OCX control and install it.

 

 

Open Delphi and close all projects.

1. Install the OCX control

Click the menu item: component-> Import ActiveX control...

Go to the following page:


Then click "add...". The following interface is displayed to select the ocx file:


NOTE: If it is a DLL file, it may not appear. You need to switch the file type to all.

After the target file is selected, the OCX control corresponding to the OCX or DLL is automatically added to the List.

Click "Install ...", The following dialog box is displayed, indicating the control package to which the control is installed. The default value is dclusr. dpk, which is the default custom control package of Delphi. Select the default value.


Click "OK" to bring up the following dclusr. dpk editing interface. The system will also prompt whether to continue compiling dclusr. dpk and select "yes ".


If compilation is complete, the OCX control is added to the ActiveX page in the Delphi IDE control bar.

 

1. Uninstall the OCX control

Click the menu item: component-> Import ActiveX control...

The page is the same as step 1. Www.2cto.com

After selecting the OCX control to be removed, click the "Remove" button. The confirmation dialog box is displayed. Click "yes" to remove the registration information of the ocx in the system. Theoretically, an exception occurs when you drag the control to the form.

However, a file remains in the custom control package. You need to open the custom control package file in the blank Delphi environment. The file is usually located in the following path:

C: \ Borland \ DELPHI6 \ Lib \ dclusr. dpk

After opening the file, the following page is displayed:


On the above page, select the file to be removed (maybe more than one) and click "Remove ".

Click "compile" to re-compile the control package.

If the compilation is normal, the system will prompt that the control has been removed and will disappear from the ActiveX page in the Delphi IDE control bar. [End]

From xt_chaoji's column

 

Installing the OCX control in Delphi

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.