Name

$DenyPackageUnit Compiler Directive

Syntax

{$DenyPackageUnit Off} // default
{$DenyPackageUnit On}

Scope

File

Description

If you enable the $DenyPackageUnit compiler directive, Delphi prevents you from using the unit in a package. Some units might perform special initialization or finalization services for an application and cannot be used in a package (which is really a DLL). For example, Delphi’s ComServ unit uses the $DenyPackageUnit directive. It implements several methods for managing a COM server DLL, and those methods must reside in the DLL itself, and not in a package DLL.

See Also

Package Directive, $WeakPackageUnit Compiler Directive

Get Delphi in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.