How to install third-party controls in Delphi

Source: Internet
Author: User

Components not provided by Borland are called third-party components:
Installation Method:
This section describes how to install common components.

1. components with only one DCU file. The DCU file is a compiled unit file. The author does not want to publish the source code. In general, the author must explain which version of this component is suitable for Delphi. if the version is incorrect, an error will occur during installation. It is because there is no source code that makes it inconvenient for users. That is, once the Delphi version is upgraded, this component cannot be used any more. Of course, some authors have provided several versions of DCU files, select and use as needed. The component installation method is as follows: In the component menu, select install component, and in the dialog box
On the "into existing package" page, click "Browse" after "unit file name". In the displayed file dialog box, set "file type" *. DCU: Find the DCU file to be installed, press OK to return to the "into existing package" page, and then press OK to install it. Note: At this time, Delphi will prompt that dclusr40.dpk will be rebuilt. If you want to continue, OK. Here is to install the component to the dclusr40.dpk package. This package can be seen from the file name as a user-defined component package. First install it into this package. Next we will talk about the precautions. After the installation is complete, there will be prompts that the component has been added and the information on which the component page is installed. Go to the component panel and check whether a new component page appears, there are just installed components.

2. Only the PAS file or component with both the PAS and DCU files. This component has a PAS file, that is, the author provides the source code, which is much easier. The installation method is the same as above. You can set the file type to DCU or pas. We recommend that you set it to PAS so that you can recompile it with your Delphi, check whether any problem occurs. After Delphi is upgraded, you can only install the PAS file so that the component can be re-compiled to adapt to the new Delphi version. Such components are worth using. Based on the experience of xinling, it is best not to use components without source code. First, they cannot be used after the Delphi version upgrade, in addition, when a program encounters a problem, the user cannot debug the component to determine whether the component contains a bug.

3. Group packages with dpk files. A component package with a dpk file generally consists of multiple components. That is to say, multiple components will be available after installation. If only one component author is generally not made into a dpk file, use the above method to publish. For such a component package, there will be a detailed installation instruction file, as mentioned above rxlib, due to the complex components and the order of installation, if the author does not provide installation instructions, the User Root cannot be correctly installed. If there is no installation instruction file, use the following method to install it: Under the File menu, select "Open ..." Open the dpk file (select *. dpk in the file type list box). In the displayed package window, the Install button is displayed on the toolbar. Click this button to install the dpk. If the Install button is invalid, compile it by pressing the compile button. Generally, the Install button is valid after compilation, and then press the Install button.

4. component packages with BPL files. Generally, this is a component package composed of multiple components. It is actually a dynamic connection library file (DLL ). To install this package, select "install packages" under the component menu, click the Add button, and find the corresponding BPL file in the open file dialog box, click OK.

5. Install ActiveX controls. To install such a configuration, register it with regsvr32.exe and select import ActiveX control from the component menu. In the window opened by import ActiveX control, only registered ActiveX controls appear in the list. Select one and click the Install button to install the control. If you have not registered regsvr32.exe in advance, you can click the Add button to find the ocx file for real-time registration, and then install it.

Notes:

1. check whether there is a description file after obtaining the component. Generally, there are instructions on how to install the component in the description file, and some instructions on how to use the attributes, events, and methods of the component, these are important in use.

2. Before installing the above components (packages), You 'd better set *. copy BPL to your system directory and copy *. pas ,*. DCU ,*. DCR ,*. DP? Copy it to the lib directory of Delphi before proceeding.

3 As mentioned above, when installing the DCU component, we chose the existing dclusr40.dpk. Of course, you can also choose to install it to a new package. If you select a new package, A name such as demo needs to be obtained first. In fact, after installation, you can find the demo. BPL, but cannot find the demo. dpk. If you have installed a component in dclusr40.dpk and want to install another component, if you want to install it in dclusr40.dpk, you will be prompted after installation, the previously installed component has been canceled and cannot be used. In this case, can only one component be installed? The two components can be used at the same time unless you install them in a new package. Of course, every time you install a component to generate a new BPL file, there is no way to do it, but the BPL file is much more. Can I install more components in dclusr40.dpk? Of course. The method is as follows: Open the dclusr40.dpk file under the File menu, click the Add button, and select the Add Unit page in the displayed dialog box, press the "Browse" button after the unit file name to open the component unit file and click OK. In this way, you can add the unit files of multiple components. After adding the component, click the compile button, then press the Install button. If the unit file is compiled (DCU), press the Install button directly.

4. Delete the component. It can only be installed, but it will also be deleted. Very easy. Under the component menu, select install packages, find the BPL in which the installation is located in the list, and press the Remove button. OK! Delete the BPL file. If you do not delete the BPL file, you can install and use the BPL component next time.

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.