Solved

How can I rebuild the Components which came with Delphi?

Posted on 1999-01-18
19
571 Views
Last Modified: 2013-11-23
 I need to change some behaviors of TDataSource, which are implemented as private methods. Creating a new class based on TDataSource is not a solution, because by looking at the VCL's source it turns out that Inprise did not follow the rules of object oriented programming all the time: some classes uses other classes private fields. It was easy for them because the classes are in the same unit. As a result in a descended class it seems almost impossible to change or reimplement some of the behaviors of the ancestor class. Also many other components use TDataSource, which makes the problem even more complicated.
  The only possibly fast solution I can think of is rebuilding the original components, but as far as I know Inprise has not published the 'dpk' files for their Delphi 4 packages. If someone happened to have those that would probably solve the problem.
  This is the first time I am trying to find help on the WEB. I would really appreciate if some had at least a good idea to get me started.
0
Comment
Question by:goodday
  • 10
  • 9
19 Comments
 
LVL 12

Accepted Solution

by:
rwilson032697 earned 200 total points
ID: 1362377
Since you have the source, you can alter it and then build it into your app. To do this add the path to the appropriate files in your Project|Options|Directories/defines tab|Search path.

You will now be able to change this code and recompile it into your app. We do this with a number of VCL files where we need to make bugfixes and or changes to support critical functionality.

I have not done this with any of the DB code though... let me know how it goes...

Cheers,

Raymond.
0
 

Author Comment

by:goodday
ID: 1362378
Hi Raymond!

Thank you for answering my question. I am afraid I need some more help because I could not get it working. This is what I have tried to do:

- copied the original VCL files I wanted to change to a new directory (without changing the filenames)
- added the directory to the search path as you had suggested
- to try if it works I added a new published property to the TTable class
- compiled it

I had expected the new property to appear among the proprties of a Table component after dragging it to a form. Well, it did not.

Please tell me what I did wrong if you know it.

I badly need to be able to recompile these components and now I am releafed because you have given me the answer but I guess I could use 'step by step instructions' because somehow it is not clear to me yet.)

Regards,

Leslie.

PS.: I appologize for my mistakes, I am not native English, and I have not spoken (written) much in English in the past 6 years. (Especially not on the Internet.)
0
 
LVL 12

Expert Comment

by:rwilson032697
ID: 1362379
Leslie:

What is happening is that at design time the TTable component will be taken from a component package supplied with Delphi that has already been built with the original source. Unfortunately this does mean that you won't see the changes at design time - but you should be able to access the new properties at runtime as the code that is compiled into your app will replace the design time component.

There are problems with compiling the VCL libraries to replace the pre-compiled design time packages that come with delphi. Not all of the source is present for all packages and you may also need an additional external tool (Turbo Assembler).

I realise this makes it a little awkward at design time, but if your changes are relatively modest this should present no real problems.

Cheers,

Raymond.
0
 

Author Comment

by:goodday
ID: 1362380
Raymond

Thanks! It is clear now. This should work!  
Combibing with descending a new class  all the functionality I need will be avaiable at design time too.

Since I do not have more points to ask an other question, if you do not mind, I would like to keep this question locked untill I actually see my code running.(Just a fiew hours).

Thanks for the quick reaction.

Leslie

PS.: I have read  a couple of 'conversation' on this server and it seems people has a way to 'ZIP' what they have to say. Hope I can learn that.

PS2.: There could be several customs about such 'conversations'.  I hope I am not violating them but it would be nice to know from which country  the answer comes from. The Q came from Hungary.
0
 
LVL 12

Expert Comment

by:rwilson032697
ID: 1362381
goodday: By all means keep the Q locked until you have it working - this is what you should do as you can then keep the conversation running until your problem is resolved. You can also add comments after the answer has been accepted.

I am unsure what you mean by ZIPping conversations.You can go back and read answers to questions that have been asked in the past - is this what you are referring to?

Cheers,

Raymond.

PS: I come from New Zealand.

0
 
LVL 12

Expert Comment

by:rwilson032697
ID: 1362382
I just got an email that there was a new comment - but there isn't. Spooky!

0
 

Author Comment

by:goodday
ID: 1362383
Raymond:

Sorry that I have kept you waiting for such a long time. The fact is that I had some unexpected problems due to changes in my hardware. Also the VCL requires more changes then I had suspected.

Otherwise your advice was exactly what I needed. It seems all clear now, but I still would like  to  keep this Q  open a little longer. (I have no time to get stuck again.)  

Regards,

Leslie.

PS: 'ZIPing' : I ment the way the English langugge is used : compact, well focused on the issue. I felt my English was not like that.

PS2: Would you (we) still be notified about the new comments after the answer has been accepted?
0
 
LVL 12

Expert Comment

by:rwilson032697
ID: 1362384
Leslie,

Yes, comments are still sent after the answer has been accepted - it is fairly common for a thread to continue after an answer has been accepted if the person asking the question still has some related issues they had not considered at the time.

BTW: Your English is really very good for someone who has not spoken or written it for some time. I had no problems understanding it.

Cheers,

Raymond.

PS: There is a time limit (about 6 weeks I think) after which an answered question is automatically closed and given a 'C' grade.

0
 

Author Comment

by:goodday
ID: 1362385
Hi Raymond,

Thank you for your help. It was very useful to me.


Good day(s),      (<--   I think this is used in Australia, but maybe I'm wrong. )

Leslie.
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 12

Expert Comment

by:rwilson032697
ID: 1362386
Hi Leslie,

"Good day" is not really used anymore in New Zealand or Australia (though it was some time ago...)

Cheers,

Raymond.
0
 

Author Comment

by:goodday
ID: 1362387
Thanks Raymond. For the encouragement too. I have decided not to be worried about my English anymore.

Leslie.
0
 

Author Comment

by:goodday
ID: 1362388
Hi Raymond,

Well, it did seem clear, but I am a bit confused again:

I am trying to modify 3 VCL files (DB, DBCommon and DbTables).
The files are in the d:\!Project\tmp\vcl dictionary, which is added to the Search path, and the files are added to the project too.
The problem is the following error message (after trying to build the App):

  "DbCtrls was built with a different version of DB.TDataLink".

TDataLink is in unit DB.

I have tried adding the DbCtrls.pas to the project as the other three, but the result was the same error with a different filename.


Do I really have to recompile all the linked VCL units ?:-( ?!!!!  
I hope it is fair to bother you with this extra question. Please let me know if I am trying to get too much help for my points, and I will ask it as a new Q.  


Regards,

Leslie.

0
 
LVL 12

Expert Comment

by:rwilson032697
ID: 1362389
I remember seeing in previous versions of Delphi that not all the source for the VCL was supplied - there were some holes in the DB support. I do not know if this is the case for D4.

You should check to see if you have the source for all of the VCL .DCU files. If you do not then you may have problems. Let me know what you find. One other thing which may complicate matters is that there may be code compiled into packages that Delphi puts into the EXE, but I am not sure about this.

Cheers,

Raymond.
0
 

Author Comment

by:goodday
ID: 1362390
Raymond,

The problem was that I only copied the files I wanted to change.
 
All the VCL sources that are required are available except for QuickReport.
It seems the only way the changes I have made in the db files can be used if I get  QuickReport Prof. which includes the source. {:|

Thanks for helping me out.

Regards,
Leslie


0
 
LVL 12

Expert Comment

by:rwilson032697
ID: 1362391
I am suprised you need the QR sources to recompile the VCL. I did not realise they were embedded into it.

Perhaps you should talk to the QR folks - they might be able to help you...

Cheers,

Raymond.

0
 

Author Comment

by:goodday
ID: 1362392
Raymond,

I have the QuickReport sourcecode now and it works fine.

I can only guess what DCU files consist of, but if I am not misstaken any change in a unit interface will make all the units which use it to be recompiled.

Most of the things I know about programming and nearly everything abut Delphi I learned by myself. The avaible hungarian books about Delphi deal only with the basics. This really hasn't got much to do with the original question but if you happened to know any  more detailed information source (book or Website) ... :-))

It is a great joy that by being able to modify the VCL source I can get behind some of problems I have been figthing with in the past year. I really appreciate your help.

Cheers,
Leslie.


PS: Since I do not have instant internet access, somites it takes me a bit longer  to answer a comment.
0
 
LVL 12

Expert Comment

by:rwilson032697
ID: 1362393
You could try www.amazon.com and search for Delphi - lots of books of varying quality (I think they have reviews...)

The Borland/Inprise sites do have various information and white papers on how to do things in Delphi.

A few searches in AltaVista should turn up more general programming sites, though I am now aware of any specific Delphe programming sites (beyond the large number of sites that contain Delphi related material such as components etc..

Cheers,

Raymond.
0
 
LVL 12

Expert Comment

by:rwilson032697
ID: 1362394
PS: Did QR charge you for the sources, or were they good about it?

Cheers,

Raymond.
0
 

Author Comment

by:goodday
ID: 1362395
Thanks for the ideas, I will try them. :-)

I did not contact  Qusoft  because I needed the source right away, my program was late already.  I will have QR purchased  for my company soon, but at the time I had no choice but copy it form a friend.

Regards,
Leslie.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video discusses moving either the default database or any database to a new volume.

747 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

10 Experts available now in Live!

Get 1:1 Help Now