SB66
SB66

Reputation: 11

Advantech DAQNavi ActiveX Components in Delphi 10.4

Has anyone had any success installing the Advantech DAQNavi components in Delphi 10.3 or 10.4 ? The big problem is that I cant find a detailed step by step explanation of how to install activex components into Delphi 10.3 or 10.4.

I pay embarcadero for support but their response is "Ask Advantech" !

I have installed the Advantech DAQNavi ActiveX components into Delphi 10.3 and everything appears to go OK without any issues but If I then add them to a form nothing shows on the form. The components appear in the structure list and I can edit them that way, the same applies if I open a project created with an earlier version of Delphi that uses the Advantech ActiveX components.

The fact that something has not worked correctly during the install worries me and I dont feel comfortable compiling projects using these components with this version of Delphi.

Upvotes: 1

Views: 504

Answers (2)

SB66
SB66

Reputation: 11

Embarcadero have now looked into it and responded :

"It is bug... it was a fix, for another bug this is one of those good intentions paving fixes."

Apparently the bug simply prevents the control appearing on the form at design time and does not affect the operation of the OCX.

Upvotes: 0

MartynA
MartynA

Reputation: 30715

Following is a step-by-step guide to installing an ActiveX component for which you have a type library in Delphi Sydney (v.10.04).

  1. Assuming you have a drive D: (I have never trusted Windows with saving important work on its boot drive), create the folder d:\D104, and 2 subfolders below it, d:\D104\Units and d:\D104Pkg.

  2. Start the Delphi IDE if not already running, or do a Close All if it is.

  3. Goto Component | Import Component in the IDE main menu.

  4. Select your type lib from the pop-up

  5. Click Next and set Palette Page to "My Imports"

  6. Click Next and set the radio button to Install to New Package.

  7. Click Next and set the Package name to e.g. D:\d104\Pkg\MyPackage.dpk and fill in the Description box as you think.

  8. Click Finish. The IDE will generate

  • a file in D:\D104\Units named like MyTypeLib.Pas (but see the comment below step 9) and

  • the file D:\D104\Pkg\MyPackage.dproj

It will then attempt to compile D:\D104\Pkg\MyPackage.Bpl, which is the package that you need to install in the IDE to have the component(s) in your typelib show up on the MyImports tab of Delphi's Component Palette. Btw, a .Bpl file is a special sort of Dll which, as well as your components, contains some "behind the scenes" code to help .Bpl files get along with one another and the IDE, including memory-sharing.

  1. Assuming the compilation generates no errors, go to Component | Install Packages in the IDE and use the Add button in the pop-up to add D:\D104\Pkg\MyPackage.Bpl and you're done.

If the compile in step 9 doesn't appear to have done anything, it's most likely because the BPL has been generated to the wrong place. Find it and delete it (because otherwise it will come back to haunt you), then:

  1. Open D:\D104\Pkg\MyPackage.dproj as a project in the IDE, then from the IDE's main menu, click Project ! Project Options & on the Project pop-up, select the "Delphi Compiler" tab, and on the right, set the package Output Directory to D:\D104\Pkg and click Save, then re-compile the project and use Component | Install Packages to install the .Bpl file.

=================================

Fwiw, in the D5/D6/D7 era, adding components to the IDE was much simpler (and IME less error-prone) because you could do the entire process using a stand-alone Package Editor.\Units

Upvotes: 1

Related Questions