DesignIntf not found in bpi but works with dcp - c++builder

In Rad Studio Rio, I create a package for Delphi.
In the PAS unit, I add:
uses DesignIntf;
The compiler complains about "DesignIntf not found". Adding DesignIntf.dcp as reference solves the problem.
Now, if I create the same package but from C++ Builder, I add "uses DesignIntf;" in the PAS unit, if I add DesignIntf.bpi as reference, the error is not fixed.
Why in Delphi DesignIntf.dcp solves the problem but DesignInt.bpi does not solve it for C++Builder with exactly the same code?
UPDATE;
It is win32 platform. The following image shows how designintf.bpi is referenced but I continue getting the error. It works as expected if the package is for Delphi and using designintf.dcp.

In both Delphi and C++, your design-time package needs a reference to the DesignIDE package in order to use the DesignIntf unit.
Please read Embarcadero's documentation:
Compiling C++ Design-Time Packages That Contain Delphi Source
Creating or Extending a Package to Use the Tools API

Finally I have solved it. I missed to add -LUDesignIDE under Delphi Compiler options. It is explained at http://docwiki.embarcadero.com/RADStudio/Rio/en/Compiling_C%2B%2B_Design-Time_Packages_That_Contain_Delphi_Source
The reason is because I mix Delphi and C++ code.

Related

Delphi 10.1 doesn't find the units added with an installed package

I use Delphi 10.1 Berlin Starter and have the following problem:
Is added some packages by opening them, and installing them by right-clicking on the package in the project manager and choosing "install". The compiled packages are now in the same folder as the other packages Delphi uses, so I think that there cannot be a problem with the library or search path.
The packages also added some Components that are now accessible in the tool palette. If I add one of these components to my program, Delphi automatically adds the unit name of the component to the "uses" section of the unit containing the component. But if I want to compile, Delphi throws the fatal error "could not find unit_name.pas".
How can I fix this? Does the units required to build and install the packages have to be included in a library path?
Maybe this is a compatibility problem. The packages were written in 2008 (Are Namespaces in Delphi younger?), so maybe the way the package wants to tell the compiler what to do does not work anymore.
This question might be difficult to understand (I had some problems to explain it...), so please comment, if you need more information.
Quite easy, I just had to add the units of the package to the library path (Tools->Options->Delphi Options->Library). Worked. Thanks to KenWhite.

Recompile modified VCL unit

I have to compile my project with a changed VCL unit. I use Delphi XE8. I copied Vcl.StdCtrls.pas from D:\Program Files (x86)\Embarcadero\Studio\16.0\source\vcl to my project folder where my .dpr file is localed, then I changed my copy of Vcl.StdCtrls.pas. I also added this unit to project tree. The problem is that with Delphi XE8 such method of recompiling VCL units no longer works. I put an obvious syntax error in my modified Vcl.StdCtrls.pas unit. Compiler does not report the error which means it does no even check the file. I always do a full build Shift+F9. I found a similar question How to recompile a specific unit from the VCL? but like I said, it no longer works, not for Delphi XE8.
Also, the modified unit is on my uses list in .dpr file:
uses
Vcl.StdCtrls in 'D:\Dev\MYPROJECT\Vcl.StdCtrls.pas',
...
// it does not help
This seems to be a bug. I guess you're using runtime packages. In XE7 such project will not compile - which is the correct behavior. In XE8 it compiles, apparently using the VCL runtime package and ignoring your modified unit.
Edit:
Note that even in previous Delphi versions, modifying a VCL unit while using runtime packages would still require you to repackage the modified packages and their dependencies (in this case, vcl and rtl).
In other words, you cannot simply use a modified unit while linking against a runtime package which contains another copy of that unit. Unit names must be unique within the full scope of the project, including the main executable and all linked runtime packages.
So the solution for you is to either:
not use runtime packages, or
repackage all required units into your own runtime packages, and link against them instead of Embarcadero-supplied rtl, vcl etc.

Delphi 7 Enterprise LibHelp is missing

While compiling Delphi 5 code in Delphi 7 Enterprise Edition, i'm getting below errro
[Fatal Error] MultLang.pas(192): File not found: 'LibHelp.dcu'
I have checked all Delphi7 folders but libhelp.dcu is not present.. any advice???
I have neither LibHelp.pas nor .dcu in my D2007, but it's used in some property editors. So I guess it's design-time stuff, and any code that uses it needs to be in a design-time package requiring designide. Your comment about Proxies.dcu hints in the same direction, so I recommend separating design-time and runtime stuff in two different packages.

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