Link to home
Start Free TrialLog in
Avatar of charlesgates22
charlesgates22Flag for United States of America

asked on

Frame inheritance in Packages

Hello,

I have a question about frame inheritance amoung multiple packages.

I have a generic frame (based on TFrame) that I like to use as a base frame throughout my software.  This frame simply has some very basic properties and events that I like to use for many of my frames.

Now the problem I am having is I have multiple packages that need access to this generic frame I have created.  I know that packages have a requirement that the base unit must be included inside the package itself.  There is also the requirement that the same unit cannot be in multiple packages.

So here is my question:  How can I make it so that I can use my generic frame amoung multiple packages without having to maintain multiple copies of the same generic frame (my current solution)?

I have tried using the repository but this does not seem to work (I realize of course that this could possibly be the answer and I havn't done it correctly).

Any help is appreciated.  Thanks.
Avatar of atul_parmar
atul_parmar
Flag of India image

There is also the requirement that the same unit cannot be in multiple packages.

I never heard so. you can use it in multiple package. can you tell me what prevents you to use it in multiple packages? or will you state how/what way you are using it?
Avatar of charlesgates22

ASKER

The same unit cannot be placed in multiple packages because it will be ambiguous to the compiler.  It won't know which one to use.

Basically I just want to use my frame for inheritance purposes.  It has some basic events/properties that I have standardized for different pieces of my software.
For example my software has things like Options, Printing selections, a list that allows users easy navigation within the software, etc.  But all these are in their own packages and are build off of my basic frame.  Since packages cannot all have my basic frame contained within them (it must be in the package in order to inherit from it) I am currently maintaining multiple copies of the same basic frame so that each package can have their own.  This was just a quick fix in order to complete what I was doing.  But I want to know how to do it correctly.

I know Borland has a vcl package that contains their common frame TFrame which can be inherited from in multiple packages without any problems.  I was hoping to find out if something similar can be done with my frame so that I can maintain one copy of my basic frame and have it available for other things as well.
ASKER CERTIFIED SOLUTION
Avatar of atul_parmar
atul_parmar
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
atul_parmar, thanks for taking the time to answer my question.

You are correct and I am rewarding you the points.  You can have multiple packages reference the same unit without the packages complaining.

What I found out was I had a exe and some dll projects that were being built with packages that contained my basic frame.  That is when the compiler complained that multiple packages contained the same unit.  So what I did was modifiy my "Build with runtime packages" and removed some unnecessary packages that it was loading.  I also modified some of its
search paths to correctly reference some of the package units.  So now even though the exe and some of the dll's have to reference multiple packages that may contian my basic frame it won't complain and it runs correctly.

Thanks again.