If you build such a project and run the obtained application, the application can generate a run-time error if it tries to access this style. To disable smart loading of components registered in a package call. From RAD Studio. Jump to: navigation , search. Categories : Windows Developer's Guide Delphi. Navigation menu Personal tools Log in. Namespaces Page Discussion. Views Read View source View history. RAD Studio Assistance Recent changes. This page was last edited on 29 October , at Add a comment.
Active Oldest Votes. Marjan Venema Marjan Venema Thanks for the detailed description: my point is that somehow Delphi knows to find the source code you can access is via the uses clause in the IDE , which is what I'm trying to achieve.
Updating the library path is of course a separate action I don't know how to do this , but it does achieve what I'm aftger. Martijn: When you ctrl-click a unit in the uses or right click and select "open file at cursor" Delphi knows where to find the source because of what is in the library path! Or in the "browsing" path. Delphi has no other way of knowing where the units are. In fact, when you empty both those paths, Delphi won't find any of the sources of any of your components.
Would adding it to dcluser. Tobiasopdenbrouw Tobiasopdenbrouw 13k 1 1 gold badge 20 20 silver badges 27 27 bronze badges. I don't know, really never used dcluser. Edited the question to make the problem clearer. DwrCymru DwrCymru 25 3 3 bronze badges.
Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. If using VCL components, you'll also need to include the vcl package. Duplicate references in a package's requires clause—or in the Runtime Packages edit box—are ignored by the compiler. For programming clarity and readability, however, you should catch and remove duplicate package references.
The contains clause identifies the unit files to be bound into the package. If you are writing your own package, put your source code in pas files and include them in the contains clause. All units included directly in a package's contains clause, or included indirectly in any of those units, are bound into the package at compile time. A unit cannot be contained directly or indirectly in more than one package used by the same application, including the IDE.
This means that if you create a package that contains one of the units in vcl you won't be able to install your package in the IDE.
To use an already-packaged unit file in another package, put the first package in the second package's requires clause. Package source files, like project files, are generated by Delphi from information you supply.
Like project files, they can also be edited manually. A package source file should be saved with the. You can compile a package from the IDE or from the command line. To recompile a package by itself from the IDE:. Click the Install button to make the package project. Right-click the package project nodes for options to install, compile, or build. You can insert compiler directives into your package source code.
For more information, see "Package-specific compiler directives" below. If you compile from the command line, you can use several package-specific switches. For more information, see "Compiling and linking from the command line" on page The following table lists package-specific compiler directives that you can insert into your source code.
Use in. Other compiler directives may be included, if appropriate, in package source code. See Compiler directives in the online Help for information on compiler directives not discussed here. See Chapter 9, "Libraries and packages," in the Delphi Language Guide for more information on package-specific compiler directives.
Refer to "Creating packages and DLLs" on page for additional directives that can be used in all libraries. For information about files generated by the compiler, see "Package files created when compiling" on page A unit compiled with this directive is said to be weakly packaged. For example, suppose you've created a package called pack1 that contains only one unit, unit1.
Suppose unit1 does not use any additional units, but it makes calls to rare. However, unit1 will still be included in pack1. If unit1 is referenced by another package or application that uses pack1, it will be copied from pack1.
Now suppose you add a second unit, unit2, to pack1. Suppose that unit2 uses unit1. But other packages or applications that reference unit1 will use the non-packaged copy taken from pack1. It can help you to avoid distribution of infrequently used DLLs, and to eliminate conflicts among packages that may depend on the same external library. For example, the PenWin unit references PenWin.
Most projects don't use PenWin, and most computers don't have PenWin. For this reason, the PenWin unit is weakly packaged in vcl. When you compile a project that uses PenWin and the vcl package, PenWin is copied from vcl If PenWin were not weakly packaged, two problems would arise. First, vcl itself would be statically linked to PenWin.
Second, if you tried to create a package that contained PenWin, a compiler error would result because the PenWin unit would be contained in both vcl and your package. Thus, without weak packaging, PenWin could not be included in standard distributions of vcl. When you compile from the command line, you can use the package-specific switches listed in the following table.
0コメント