Exporting Functions from Packages

Given that packages are simply enhanced DLLs, it seems that you should be able to export functions and procedures from packages just as you can from DLLs. Well, you can. In this section, we'll show you how to use packages in the same way.

Launching a Form from a Package Function

Listing 14.3 is a unit contained inside of a package.

Listing 14.3. Package Unit with Two Exported Functions
unit FunkFrm; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TFunkForm = class(TForm) Label1: TLabel; Button1: TButton; private { Private declarations } public { Public declarations } end; // Declare the package functions using the StdCall calling convention procedure ...

Get Borland® Delphi™ 6 Developer's Guide 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.