Solved

Component Storage Mechanism

Posted on 1997-09-27
5
279 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

911 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now