tags:

views:

116

answers:

2

Dear experts,

I just created a form within bpl project and place it on repository, named AncForm. When I made its descendant in a new project (program Inheritance1) named DecForm. Normally, AncForm will be included in the new project automatically when DecForm just inherited from AncForm.

program Inheritance1;

{$R *.res}

uses

  Forms,
  cAncForm in 'cAncForm.pas' {AncForm}, //-----> Ancestor ..... Line A
  uDecForm in 'uDecForm.pas' {DecForm}; //-----> Descendant ..... Line B

begin
  Application.Initialize;
  Application.CreateForm(TDecForm, DecForm);
  Application.Run;
end.

The question is: is there any way to link the DecForm to AncForm within this project without the presence of "Line A"? I mean the AncForm is not visually linked to project but still be able to provide reference to DecForm within IDE, without "error creating form...".

I hope there is a way to fully wrap the ancestor inside BPL.

I would gratefully thanks for any idea.

+7  A: 

You need to add the package project in which the ancestor form lives to the same project group as your applications. The IDE will notice that the form is in the package project and not add it to the uses list of the application project.

Allen Bauer
+1 Note that if you develop your project with a team of people, then all people need to have the version of the package containing all forms required by the specific version of the application you are dealing with.
Jeroen Pluimers
A: 

Thanks, excellent idea.

I'm wondering if there are some tricks or workaround to use only descendant form in the project such as TForm never bring TCustomForm into project.

Anyway, your solutions lead me a step ahead.