Importing ActiveX in Delphi 2005

Posted by z11g2 on June 01, 2005

This procedure was posted by webmaster Guido on January 16, 2005. I followed the procedure described below but on step 4 I did not get the install radio button, only the create unit radio button that is checked. The only option I have is to click on finish. When I did the unit XXXX_TLB appears. Is there something else I have to do so that I will have the install radio button to appear so that I can import my activex control? Installing activex control in Delphi 5 works.

Importing an ActiveX control is pretty much the same for all versions of Delphi:

1. Select Component / Import ActiveX Control.
2. In the dialog window that opens, select the ActiveX control that you wish to import, for example: "CCRP Animation Control" (CCRPANI6.OCX).
In the box labeled "Class names", you will see the classes that are contained in this ActiveX; in my example, this was only one class: TccrpAnimation.
3. In the same dialog, select the "Palette Page" where you wish to add the component(s). You can
leave the ActiveX option selected.
4. Click the Install button.
5. Select an existing package where the new control(s) must be installed, or
create a new package.
6. Click OK.
7. Delphi will ask you whether you want to rebuild the package or not. Click the Yes button.
8. After the package is compiled, Delphi says in a message that the new ActiveX component is registered, TccrpAnimation in our example. Click OK.
9. Close the package detail window.

The new component is now available on the ActiveX component palette page, or on another palette page if you changed this in step 3. It's ready to be used in your applications.

Important:

1. The ActiveX component is linked into the executable file of your program that you uses this component. However, you MUST ALSO distribute the .OCX file with your application!

2. An ActiveX control needs to be registered on the computer before its first use. Thus, on every computer where you install an application that uses your ActiveX.
Installation programs, such as InstallShield, automatically take care of this registration.

Related Articles and Replies


 

Delphi Forum :: Tutorials :: Source code :: Tips