Solved

Component Storage Mechanism

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

762 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

19 Experts available now in Live!

Get 1:1 Help Now