Solved

Component Storage Mechanism

Posted on 1997-09-27
5
292 Views
Last Modified: 2010-04-04
I have a problem that seems to lie with the mechanism that Delphi uses to store the representation of components.  I am attempting to use an existing components source as the basis for a new component I wish to develop. Inheritance is not appropriate as I am going to be making substantial
numbers of amendments to the functionality, but the source solves a lot of development issues I would otherwise have.  I have taken these steps as a start point:
1 I set up a new component (with appropriate name changes) inheriting from the parent of the component I wish to copy.
2 copied the source of the component
3 Written a registrtion unit, again copying the source relevant to that I wish to use, and registered the copy.
4. Because of the problems I am having I have checked the (60 page) source line by line and am confident that it is identical to the original.
At this stage the component should be identical to my source (except for name).  The component appears to work correctly in design mode (except for some property editors I have not yet copied).  When running the component
part of it (the tabs in a tabbed notebook) get duplicated.  The problems arise when ReadState is called, and appear to be related to the storage of information as the duplication is reflected in the Object Inspector.  The other characteristic of the copy and the original that differs is that when viewing a form as tezt the original places comparatively little information, while the copy places a great deal of information in the text file (including full details of constituant components which do not written out in the original).

Can anybody provide assistance as to how to tackle identifying and isolating this problem.

Cheers
Chris Walton
0
Comment
Question by:cjwal1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 3

Expert Comment

by:mirek071497
ID: 1346365
I must know more, but you say so this component is big. Mail the source to me, mayby i can help you.
mirek@izabell.itcomp.tpnet.pl
0
 
LVL 1

Accepted Solution

by:
dionysos_swamp earned 200 total points
ID: 1346366
copy the source file, not just the contents:
copy original.pas messedup.pas
then do a search and replace in the file replacing all the Toriginal words with Tmessedup, then check the files that the messedup.pas file uses, it might be one of the sub-components that do some stuff with the Toriginal class, therefore check the used units for refrences to Toriginal and take care of these refrences (by making the new subunits with refrences to Tmessedup) you know that you have succeeded when you can recopmpile the vcl and get it to work like the original...
0
 

Author Comment

by:cjwal1
ID: 1346367
All references from called classes had already been dealt with as all the called classes were originally contained in one unit.  I have out all the references in these subordinate classes.  I will attempt you suggestion as to copying the files, though I will complete this over the next couple of days.

Chris
0
 
LVL 12

Expert Comment

by:andrewjb
ID: 1346368
Just to point out that the VCL source, if that is what you are using, doesn't exactly reflect the components on the palette!
0
 

Author Comment

by:cjwal1
ID: 1346369
Thanks all sorted as a result of this approach.

Cheers
Chris
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question