mehr
mehr

Reputation: 855

ActiveX installation in Delphi 7.0

I am using an ActiveX component in my projects. I can add this component to Visual Studio 2010, 2008, Delphi XE2, Visual Basic 6.0, but I cannot import this into Delphi versions 5, 6 or 7.

This is the activex file in my ftp server: Active X File

Upvotes: 0

Views: 2419

Answers (1)

David Heffernan
David Heffernan

Reputation: 612954

OK, I was brave enough to download and register this OCX and try to replicate what you did. And yes I found the same behaviour as your reported.

So, I looked at the imported type library unit in XE2. Remember that in XE2 a component appears on the palette. At the bottom of the unit is this code:

procedure Register;
begin
  RegisterComponents(dtlOcxPage, [TTAK_Control]);
end;

This code registers the component in the palette and it is missing when the OCX is imported in Delphi 6, the only old Delphi I have to hand. Indeed the entire TTAK_Control component is missing from the import unit. Sometimes the import process fails.

So I simply took the imported type library file from XE2 and copied it over the top of the equivalent unit in D6. That's the unit named TAK_ControlBoard_TLB. When I compiled in D6 there was a compiler error because UIntPtr was not recognised. Replace that with Cardinal in D6. At that point the compilation succeeds and the component appears on the palette.

Now, when I attempt to add it to a form an OLE error is produced, but I can't really help with that since I know nothing about the component. Note that this error occurs in both XE2 and D6.

Upvotes: 3

Related Questions