Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Component Storage Mechanism

Posted on 1997-09-27
5
Medium Priority
?
297 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 400 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses
Course of the Month12 days, 16 hours left to enroll

971 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