ActiveX installation in Delphi 7.0 - delphi

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

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.

Related

Is it possible to modify System.Classes.pas in Delphi Rio (10.3.3)

I am upgrading a project from Delphi XE3 to Delphi Rio 10.3.3. The project contains a number of fixes to the VCL and RTL units, made by copying units from the Delphi install into a path inside the project and applying modifications. This still appears to work so long as the correct compiler options are specified in the unit, but this does not seem to work for System.Classes.pas, getting the infamous error:
F2051 Unit AAA was compiled with a different version of BBB
Has anybody been able to modify System.Classes.pas for Delphi Rio, and if so which compiler switches did you use? I note from this answer: https://stackoverflow.com/a/24145450/12683559 that this was broken in XE6 but worked again in XE7.

Strange behavior with a project in Delphi 7

I am migrating a project from Delphi 7 to Delphi XE2.
I am still working on it but when I run the project in Delphi XE2, it stopped in a function which calls a unit from a third party component. This unit was not initialized so I expected this error.
However, when I compiled the project in Delphi 7 and I got to the part where it should break like in XE2, it works normally. Therefore, I proceed to inspect this unit in the project, when i try to compile now, with the unit opened in the IDE. it show this message.
Field FormPropiedadesElemento.SpinVector does not have a corresponding component. Remove the declaration?
After I click "NO", the project runs but now stops in the same part as the Delphi XE2 project.
This problem only happens in Delphi 7 when I am seeing the code from this unit.
Any idea what could it be or how to solve it?
Usually, this happens because you don't have the appropriate design-time package for that component installed in the IDE.
What the error means is that you have a field in the IDE-managed part of your form declaration that does not have a corresponding component in the dfm file.

F2063 Could not compile used unit 'QuickPDF0724.pas'' error in Delphi XE4

I have included QuickPDF0724 unit in uses in one of my pas file. I have give the path of this unit in Tools --> Options. But I am getting the error: "F2063 Could not compile used unit 'QuickPDF0724.pas'"
In the path mentioned of that unit, only dcu file is there, no pas file.
Same code is working fine in Delphi 7 but not in Delphi XE4. What could be the reason?
In the path mentioned of that unit, only dcu file is there, no pas file.
DCUs are Delphi version dependent.
So your DCU made in Delphi 7 cannot be read by Delphi XE4 and by any other Delphi version but Delphi 7 (with the same set of updates installed - those updates may change Delphi RTL and make dependencies in those DCUs fail).
That means you either need to take QuickPDF0724.pas and compile it with your version of Delphi XE4, or you need to find someone who would do it for you and then send you the resulting DCU they made (wither possible - made exactly for the same Build of Delphi XE4 (Build number is changed by installing update packs) as you have).
My Delphi 7 application was using QuickPDF0724 and same I was trying in Delphi XE4. QuickPDF0724 has version number 7.24. This was not compatible with Delphi XE4.
So, I downloaded latest version of QuickPDF i,e DebenuPDFLibrary1011 having version number 10.11 which is compatible with Delphi XE4.
I did few changes in the code like:
Changed unit name in uses from QuickPDF0724 to DebenuPDFLibrary1011.
Changed declaration in the code like objQuickPDF : TDebenuPDFLibrary1011 from objQuickPDF : TQuickPDF0724
Changed constructor: objQuickPDF := TDebenuPDFLibrary1011.Create instead of objQuickPDF := TQuickPDF0724.Create
Rest was fine...

Delphi XE4 "class not found" but compiles fine

The GUI for my company's main product was written in Delphi in the late '90's, and has been updated to Delphi 2007. I'm working with a group to update the Delphi 2007 to XE4.
We still use a number of components from ADL VCL (similar to DevExpress, but now defunct), but have not installed the entire package. Rather, we have the files we need located in a folder seperate from our project folder, and have the path to these files specified in:
Tools-Options-Library-browsing path
and
Project-Options-search path
When I open main, I get the error:
"TADLAboutBox not found. Ignore the error and continue?"
The unit "ADLAbout" that defines "ADLAboutBox" is declared in the uses clause in main.
Moreover, our project compiles just fine.
How can I get rid of these messages? What might be wrong?
Thanks very much for your advice.
The component is not installed in the IDE, so when you open a form that uses that component you get an error.
But the source to the component can be found so when you compile it will do that without problems.
To get rid of the error you must install the component in the IDE.
ADL VCL is not available for XE4, since it was discontinued some time before XE4 was released. If you have the ADL source code, and have ported it to XE4, then it's plausible that you may have some success.
The error message you describe is symptomatic of not having the design-time packages for the components installed. You'll need to build and install design-time packages for any components that you want to interact with at design-time.

Converting Delphi 7 property editor to Delphi XE2

First of all, I have never written a property editor from scratch, but had some help with one in another question. Refer to the accepted answer there. This was in Delphi 7, and now I have started using XE2 and I have to make sure my property editor is compatible with both 7 and XE2.
It's essentially a collection editor, with the difference that each collection item has its own named component in the parent form. Is there anything new about the property editors in XE2 since 7, since it is a huge version jump?
I do NOT want to make a complete copy of my unit for different versions. I want to maintain all possible versions in one unit.
Edit
It appears that Delphi XE2 has the same property editors as Delphi 7, but the issue I was facing was that although I was including DesignIDE in my package, it could not find anything, so I had to add the ToolsAPI folder to my library path.
However, now I have a new issue after this.
[DCC Fatal Error] ToolsAPI.pas(18): F1026 File not found: 'DockForm.dcu'
I'm lost in the whole concept of BPL packages and requiring others, etc.
DesignIntf, DesignEditors, DesignMenus, DesignWindows are part of DesignIDE.bpl and is found in \Embarcadero\RAD_Studio\9.0\lib\win32\release\designide.dcp. But there is no designide.dcp for 64bit which is why it throws an error when compiling a 64bit package that references these units.
There is no 64bit version of DesignIDE because it is for a design time package and design time packages are 32 bit only (remember Delphi IDE is still only 32 bits). So always set your design time package as 32bit, not 64bit. :)
Mike
The DockForm.pas source code is available neither in Delphi XE nor in Delphi XE2.
You may try this accepted answer posted on SO applying to similar issue on Delphi 2010.
Presumably, it is compiled and included within some package already distributed with Delphi XE2.

Resources