Link to home
Start Free TrialLog in
Avatar of goodday
goodday

asked on

How can I rebuild the Components which came with Delphi?

 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.
ASKER CERTIFIED SOLUTION
Avatar of rwilson032697
rwilson032697

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of goodday
goodday

ASKER

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.)
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.
Avatar of goodday

ASKER

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.
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.

I just got an email that there was a new comment - but there isn't. Spooky!

Avatar of goodday

ASKER

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?
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.

Avatar of goodday

ASKER

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.
Hi Leslie,

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

Cheers,

Raymond.
Avatar of goodday

ASKER

Thanks Raymond. For the encouragement too. I have decided not to be worried about my English anymore.

Leslie.
Avatar of goodday

ASKER

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.

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.
Avatar of goodday

ASKER

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


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.

Avatar of goodday

ASKER

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.
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.
PS: Did QR charge you for the sources, or were they good about it?

Cheers,

Raymond.
Avatar of goodday

ASKER

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.