How can I work with ‘packages dynamically loaded’ which contain forms inside them?

Written by Francisco R.

The executable you are going to use to load those dynamical packages (dpl, bpl) must have enabled the ‘Build with runtime packages‘ option, besides, on the edition’s field corresponding to this option must appear the name of the JfControls’ package(s) that that executable will use, thus: JfCtrls_d6;JfCtrlsGrid_d6

This option should be at ‘Project Options‘ / Packages Tab.

In addition, this edition’s field must also include all those packages of Delphi you also want to use along your application.

You must register each and every package’s unit (dpl, bpl) with a form inside as follows:

initialization
  RegisterClass(TFrForm1);
finalization
  UnRegisterClass(TFrForm1);

To create those forms within the dynamical packages, you should use the following JfControls functions:

procedure JfWndPkgCreate(AOwner: TCustomForm; var AForm: TForm; ALibrary: String; AFormClass: String; ACenterOptions: TJfCenterOptions);
procedure JfWndPkgCreateModal(AOwner: TCustomForm; var AForm: TForm; ALibrary: String; AFormClass: String; ACenterOptions: TJfCenterOptions);
procedure JfWndPkgShow(AOwner: TCustomForm; var AForm: TForm; ALibrary: String; AFormClass: String; ACenterOptions: TJfCenterOptions);
function JfWndPkgShowModal(AOwner: TCustomForm; var AForm: TForm; ALibrary: String; AFormClass: String; ACenterOptions: TJfCenterOptions): TModalResult;

For instance:

 TFrMain = class(TForm)
    JfCApp: TJfCApplication;
    CForm: TJfCForm;
    JfSpeedButton1: TJfSpeedButton;
    JfSpeedButton2: TJfSpeedButton;
    procedure JfSpeedButton1Click(Sender: TObject);
    procedure JfSpeedButton2Click(Sender: TObject);
    procedure CFormFormDestroy(Sender: TObject);
  private
    { Private declarations }
    f1, f2: TForm;
  public
    { Public declarations }
  end;
procedure TFrMain.JfSpeedButton1Click(Sender: TObject);
begin
  JfWndPkgShow(Self, f1, 'FormsPkg.dpl', 'TFrForm1', ceoPriorWindow);
end;
procedure TFrMain.JfSpeedButton2Click(Sender: TObject);
begin
  JfWndPkgShow(Self, f2, 'FormsPkg.dpl', 'TFrForm2', ceoPriorWindow);
end;
procedure TFrMain.CFormFormDestroy(Sender: TObject);
begin
  if Sender = f1 then f1 := nil;
  if Sender = f2 then f2 := nil;
end;

Version: 20.08.21

Size: 87.7 MB

Published: August 9, 2020

JfControls Standard library Trial (RADXE5, RADXE6, RADXE7, RADXE8, RAD10, RAD10.1, RAD10.2, RAD10.3) and documentation

Available in: [types field='disponible-en'][/types]


Version: 1.0.0

Size: 28 KB

Published: August 12, 2020

Packages Dynamically loaded Sample (Delphi 3)

Available in: [types field='disponible-en'][/types]


Version: 21.10.01

Size: 134.00 MB

Published: October 1, 2020

JfControls Library Standard (CBuilder6, Delphi7, BDS2006, RAD2007, RAD2009, RAD2010, RADXE, RADXE2, RADXE3, RADXE4, RADXE5, RADXE6, RADXE7, RADXE8, RAD10, RAD10.1, RAD10.2, RAD10.3, RAD10.4), English and Spanish documentation, demo programs source code, demo programs exes, utils programs

Available in: [types field='disponible-en'][/types]


Version: 20.08.21

Size: 5.37 MB

Published: August 9, 2020

JfControls Grid library Trial (RADXE5, RADXE6, RADXE7, RADXE8, RAD10, RAD10.1, RAD10.2, RAD10.3)

Available in: [types field='disponible-en'][/types]


Version: 1.0.0

Size: 30 KB

Published: August 12, 2020

Packages Dynamically loaded Sample (Delphi 5)

Available in: [types field='disponible-en'][/types]


Version: 21.10.01

Size: 22.70 MB

Published: October 1, 2020

JfControls Library Grid (CBuilder6, Delphi7, BDS2006, RAD2007, RAD2009, RAD2010, RADXE, RADXE2, RADXE3, RADXE4, RADXE5, RADXE6, RADXE7, RADXE8, RAD10, RAD10.1, RAD10.2, RAD10.3, RAD10.4), demo programs source code, demo programs exes, utils programs

Available in: [types field='disponible-en'][/types]


Version: 11.09.07

Size: 13.8 MB

Published: August 9, 2020

JfControls Standard and Grid demo programs

Available in: [types field='disponible-en'][/types]


Version: 1.0.0

Size: 30 KB

Published: August 12, 2020

Packages Dynamically loaded Sample (Delphi 6)

Available in: [types field='disponible-en'][/types]


Version: 21.10.01

Size: 2.05 MB

Published: October 1, 2020

JfControls Library and utils source code

Available in: [types field='disponible-en'][/types]



You may also like…

What’s Coming in 10.4.2 Sydney

What’s Coming in 10.4.2 Sydney

Am I the only one who gets excited about new releases? If you look at the RAD Studio Roadmap you will see a new 10.4.2 release of Sydney is scheduled for the first half of 2021. If you are on Update Subscription then you were invited to the NDA 10.4.2 Hunter beta....

DELPHICON 2020

DELPHICON 2020

The official online conference all about Embarcadero Delphi November 17-19, 2020 The Best Delphi Content, Top Experts, All Online, and All Free! 20% discount coupon for purchases made on DELPHICON days: SENDASOFTDELPHICON2020 Register

0 Comments

Submit a Comment